Skip to content

Commit

Permalink
will not discover new test, no matter what! will push to server to se…
Browse files Browse the repository at this point in the history
…e if build box does recognize.
  • Loading branch information
Cathal McHale committed Jul 3, 2019
1 parent e85e10c commit ea8f792
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/Ray.Domain.Test/Ray.Domain.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Xunit.Gherkin.Quick" Version="3.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\app\Ray.Domain\Ray.Domain.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="features\tuples\BasicOperations.feature">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="features\tuples\ComparePointsAndVectors.feature">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
40 changes: 40 additions & 0 deletions test/Ray.Domain.Test/Tuples/BasicOperationsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System.Numerics;
using Xunit;
using Xunit.Gherkin.Quick;

namespace Ray.Domain.Test.Tuples
{
[FeatureFile("./features/tuples/BasicOperations.feature")]
public sealed class BasicOperationsTests : Feature
{
private Vector4 _firstTuple = new Vector4(),
_secondTuple = new Vector4();

[Given(@"a1 = tuple (\d) (-\d) (\d) (\d)")]
public void One(float x, float y, float z, float w)
{
_firstTuple.X = x;
_firstTuple.Y = y;
_firstTuple.Z = z;
_firstTuple.W = w;
}

[And(@"a2 = tuple (-\d) (\d) (\d) (\d)")]
public void Two(float x, float y, float z, float w)
{
_secondTuple.X = x;
_secondTuple.Y = y;
_secondTuple.Z = z;
_secondTuple.W = w;
}

[Then(@"a1 plus a2 = tuple (\d) (\d) (\d) (\d)")]
public void Three(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));
}

}
}
11 changes: 11 additions & 0 deletions test/Ray.Domain.Test/features/tuples/BasicOperations.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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

Background:
Given a1 = tuple 3 -2 5 1

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

0 comments on commit ea8f792

Please sign in to comment.