Skip to content

Commit

Permalink
Add TestCounter
Browse files Browse the repository at this point in the history
  • Loading branch information
isidore committed Sep 22, 2016
1 parent 7790e15 commit b71fbe9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Binary file added CSharp/FakeItTillYouMakeIt/CounterDisplay.jar
Binary file not shown.
15 changes: 15 additions & 0 deletions CSharp/FakeItTillYouMakeIt/FakeItTillYouMakeIt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ApprovalTests, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f, processorArchitecture=MSIL">
<HintPath>..\packages\ApprovalTests.3.0.12\lib\net40\ApprovalTests.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ApprovalUtilities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f, processorArchitecture=MSIL">
<HintPath>..\packages\ApprovalUtilities.3.0.12\lib\net45\ApprovalUtilities.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ApprovalUtilities.Net45, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ApprovalUtilities.3.0.12\lib\net45\ApprovalUtilities.Net45.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
</ItemGroup>
<Choose>
Expand All @@ -53,6 +65,9 @@
<Compile Include="FizzBuzzTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
Expand Down
13 changes: 12 additions & 1 deletion CSharp/FakeItTillYouMakeIt/FizzBuzzTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using ApprovalTests.Utilities;
using ApprovalUtilities.Utilities;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FizzBuzzFake
{
Expand All @@ -7,6 +10,14 @@ public class FizzBuzzTest
{
[TestMethod]
public void TestFizzBuzz()
{
var java = PathUtilities.LocateFileFromEnviormentPath("javaw.exe");
var counterDisplayJar = PathUtilities.GetAdjacentFile("CounterDisplay.jar");
TestCounter.ResetAndLaunch(java.FirstOrDefault(), counterDisplayJar);// Comment out after 1st run
TestCounter.Track(Check20);
}

private static void Check20()
{
string expected = "1,2,Fizz,4,Buzz,Fizz,7,8,Fizz,Buzz,11,Fizz,13,14,FizzBuzz,16,17,Fizz,19,Buzz";
Assert.AreEqual(expected, FizzBuzz.Print(20));
Expand Down

0 comments on commit b71fbe9

Please sign in to comment.