Skip to content

Commit

Permalink
Replace FakeItEasy with custom class (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnyrup committed Nov 5, 2018
1 parent 3b3f43a commit 31b959d
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 76 deletions.
1 change: 0 additions & 1 deletion Tests/Net45.Specs/Net45.Specs.csproj
Expand Up @@ -11,7 +11,6 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="4.8.1" />
<PackageReference Include="Chill" Version="3.2.0" />
<PackageReference Include="FakeItEasy" Version="4.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
Expand Down
1 change: 0 additions & 1 deletion Tests/Net47.Specs/Net47.Specs.csproj
Expand Up @@ -11,7 +11,6 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="4.8.1" />
<PackageReference Include="Chill" Version="3.2.0" />
<PackageReference Include="FakeItEasy" Version="4.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
Expand Down
1 change: 0 additions & 1 deletion Tests/NetCore.Specs/NetCore.Specs.csproj
Expand Up @@ -7,7 +7,6 @@
<LangVersion>7.2</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="4.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
Expand Down
3 changes: 1 addition & 2 deletions Tests/NetCore20.Specs/NetCore20.Specs.csproj
Expand Up @@ -10,7 +10,6 @@
<PackageReference Include="Chill" Version="3.2.0">
<NoWarn>NU1701</NoWarn>
</PackageReference>
<PackageReference Include="FakeItEasy" Version="4.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="xunit" Version="2.4.1" />
Expand All @@ -25,4 +24,4 @@
<ProjectReference Include="..\AssemblyB\AssemblyB.csproj" />
</ItemGroup>
<Import Project="..\Shared.Specs\Shared.Specs.projitems" Label="Shared" />
</Project>
</Project>
1 change: 0 additions & 1 deletion Tests/NetStandard13.Specs/NetStandard13.Specs.csproj
Expand Up @@ -8,7 +8,6 @@
<LangVersion>7.2</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="4.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
Expand Down
139 changes: 73 additions & 66 deletions Tests/Shared.Specs/ExceptionAssertionSpecs.cs

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions Tests/Shared.Specs/ThrowAssertionsSpecs.cs
@@ -1,5 +1,4 @@
using System;
using FakeItEasy;
using Xunit;
using Xunit.Sdk;

Expand All @@ -13,8 +12,7 @@ public void When_subject_throws_expected_exception_it_should_not_do_anything()
//-----------------------------------------------------------------------------------------------------------
// Arrange
//-----------------------------------------------------------------------------------------------------------
IFoo testSubject = A.Fake<IFoo>();
A.CallTo(() => testSubject.Do()).Throws(new InvalidOperationException());
Does testSubject = Does.Throw<InvalidOperationException>();

//-----------------------------------------------------------------------------------------------------------
// Act / Assert
Expand All @@ -41,7 +39,7 @@ public void When_subject_does_not_throw_exception_but_one_was_expected_it_should
{
try
{
IFoo testSubject = A.Fake<IFoo>();
Does testSubject = Does.NotThrow();

testSubject.Invoking(x => x.Do()).Should().Throw<Exception>();

Expand Down

0 comments on commit 31b959d

Please sign in to comment.