Skip to content

Commit

Permalink
Finally working. Logged issue:
Browse files Browse the repository at this point in the history
  • Loading branch information
Cathal McHale committed Jul 3, 2019
1 parent de10ca1 commit fbd4337
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
14 changes: 2 additions & 12 deletions test/Ray.Domain.Test/Ray.Domain.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Tuples\ComparePointsAndVectorsTests.cs" />
<Compile Remove="Tuples\ConvertTupleToPointOrVectorTests.cs" />
</ItemGroup>

<ItemGroup>
<None Include="Tuples\ComparePointsAndVectorsTests.cs" />
<None Include="Tuples\ConvertTupleToPointOrVectorTests.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />
Expand All @@ -35,10 +25,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="features\tuples\ComparePointsAndVectors.feature">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="features\tuples\ConvertTupleToPointOrVector.feature">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

Expand Down
7 changes: 3 additions & 4 deletions test/Ray.Domain.Test/Tuples/BasicMathOpsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public sealed class BasicMathOpsTests : Feature
_secondTuple = new Vector4();

[Given(@"a1 = tuple (\d) (-\d) (\d) (\d)")]
public void One(float x, float y, float z, float w)
public void InitializationValues_SetOnFirstTuple(float x, float y, float z, float w)
{
_firstTuple.X = x;
_firstTuple.Y = y;
Expand All @@ -20,7 +20,7 @@ public void One(float x, float y, float z, float w)
}

[And(@"a2 = tuple (-\d) (\d) (\d) (\d)")]
public void Two(float x, float y, float z, float w)
public void InitializationValues_SetOnSecondTuple(float x, float y, float z, float w)
{
_secondTuple.X = x;
_secondTuple.Y = y;
Expand All @@ -29,12 +29,11 @@ public void Two(float x, float y, float z, float w)
}

[Then(@"a1 plus a2 = tuple (\d) (\d) (\d) (\d)")]
public void Three(float x, float y, float z, float w)
public void GivenExpectedAnswer_PerformAddition_VerifyResult(float x, float y, float z, float w)
{
var expectedResult = new Vector4(x, y, z, w);
var actualResult = Vector4.Add(_firstTuple, _secondTuple);
Assert.True(expectedResult.Equals(actualResult));
}

}
}
8 changes: 4 additions & 4 deletions test/Ray.Domain.Test/features/tuples/BasicMathOps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Feature: BasicTuplesMathFeature
In order to move around 3D space
As a Ray Tracer
I want the ability to perform basic math on points and vectors

Scenario: Adding two tuples
Scenario: Adding two tuples
Given a1 = tuple 3 -2 5 1
​​And a2 = tuple -2 3 1 0
​​Then a1 plus a2 = tuple 1 1 6 1
And a2 = tuple -2 3 1 0
Then a1 plus a2 = tuple 1 1 6 1

0 comments on commit fbd4337

Please sign in to comment.