Skip to content

Commit

Permalink
Merge pull request #189 from CoraleStudios/feature/system-effects
Browse files Browse the repository at this point in the history
Implement new system effects
  • Loading branch information
brandonscott authored Jul 26, 2016
2 parents 846bd55 + a39886e commit 405cc82
Show file tree
Hide file tree
Showing 31 changed files with 2,411 additions and 21 deletions.
10 changes: 10 additions & 0 deletions Corale.Colore.Tests/Corale.Colore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Core\ColorTests.cs" />
<Compile Include="Razer\DevicesTests.cs" />
<Compile Include="Razer\Effects\BlinkingTests.cs" />
<Compile Include="Razer\Effects\BreathingTests.cs" />
<Compile Include="Razer\Effects\CustomTests.cs" />
<Compile Include="Razer\Effects\NoneTests.cs" />
<Compile Include="Razer\Effects\ReactiveTests.cs" />
<Compile Include="Razer\Effects\SpectrumCyclingTests.cs" />
<Compile Include="Razer\Effects\StarlightTests.cs" />
<Compile Include="Razer\Effects\StaticTests.cs" />
<Compile Include="Razer\Effects\WaveTests.cs" />
<Compile Include="Razer\Headset\Effects\BreathingTests.cs" />
<Compile Include="Razer\Headset\Effects\StaticTests.cs" />
<Compile Include="Razer\Keyboard\Effects\BreathingTests.cs" />
Expand Down Expand Up @@ -146,6 +155,7 @@
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
46 changes: 46 additions & 0 deletions Corale.Colore.Tests/Razer/Effects/BlinkingTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <copyright file="BlinkingTests.cs" company="Corale">
// Copyright © 2015-2016 by Adam Hellberg and Brandon Scott.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// "Razer" is a trademark of Razer USA Ltd.
// </copyright>

namespace Corale.Colore.Tests.Razer.Effects
{
using Corale.Colore.Core;
using Corale.Colore.Razer.Effects;

using NUnit.Framework;

[TestFixture]
public class BlinkingTests
{
[Test]
public void ShouldConstructWithCorrectColor()
{
Assert.That(new Blinking(Color.Red).Color, Is.EqualTo(Color.Red));
}

[Test]
public void ShouldConstructWithCorrectParameter()
{
Assert.That(new Blinking(Color.Black, 42).Parameter, Is.EqualTo(42));
}
}
}
76 changes: 76 additions & 0 deletions Corale.Colore.Tests/Razer/Effects/BreathingTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// <copyright file="BreathingTests.cs" company="Corale">
// Copyright © 2015-2016 by Adam Hellberg and Brandon Scott.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// "Razer" is a trademark of Razer USA Ltd.
// </copyright>

namespace Corale.Colore.Tests.Razer.Effects
{
using Corale.Colore.Core;
using Corale.Colore.Razer.Effects;

using NUnit.Framework;

[TestFixture]
public class BreathingTests
{
[Test]
public void ShouldConstructWithCorrectParameter()
{
Assert.That(new Breathing(42).Parameter, Is.EqualTo(42));
}

[Test]
public void ShouldConstructWithCorrectType()
{
Assert.That(new Breathing(BreathingType.One, Color.Black, Color.Black).Type, Is.EqualTo(BreathingType.One));
}

[Test]
public void ShouldConstructWithCorrectFirstColor()
{
Assert.That(new Breathing(BreathingType.Two, Color.Red, Color.Blue).First, Is.EqualTo(Color.Red));
}

[Test]
public void ShouldConstructWithCorrectSecondColor()
{
Assert.That(new Breathing(BreathingType.Two, Color.Red, Color.Blue).Second, Is.EqualTo(Color.Blue));
}

[Test]
public void ShouldUseRandomTypeWithNoColors()
{
Assert.That(Breathing.Create().Type, Is.EqualTo(BreathingType.Random));
}

[Test]
public void ShouldUseOneTypeWithOneColor()
{
Assert.That(new Breathing(Color.Red).Type, Is.EqualTo(BreathingType.One));
}

[Test]
public void ShouldUseTwoTypeWithTwoColors()
{
Assert.That(new Breathing(Color.Red, Color.Blue).Type, Is.EqualTo(BreathingType.Two));
}
}
}
Loading

0 comments on commit 405cc82

Please sign in to comment.