Skip to content

Commit

Permalink
Upgrade Rocks to v8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBock authored Jan 22, 2024
1 parent 3eaa92c commit 161bd76
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 33 deletions.
4 changes: 2 additions & 2 deletions BenchmarkMockNet/All.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using BenchmarkMockNet.Benchmarks;
using FakeItEasy;
using Moq;
Expand Down Expand Up @@ -30,6 +30,6 @@ public static class All
typeof(Mock).Assembly.GetName(),
typeof(Substitute).Assembly.GetName(),
typeof(MockBase<byte>).Assembly.GetName(),
typeof(Rock).Assembly.GetName()
typeof(RockCreateAttribute<>).Assembly.GetName()
};
}
16 changes: 8 additions & 8 deletions BenchmarkMockNet/BenchmarkMockNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12"/>
<PackageReference Include="JustMock" Version="2023.3.1122.188"/>
<PackageReference Include="Moq" Version="4.20.70"/>
<PackageReference Include="NSubstitute" Version="5.1.0"/>
<PackageReference Include="FakeItEasy" Version="8.1.0"/>
<PackageReference Include="PCLMock" Version="5.1.3"/>
<PackageReference Include="Rocks" Version="7.3.0"/>
<PackageReference Include="System.IO.Abstractions" Version="20.0.15"/>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="JustMock" Version="2023.3.1122.188" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="FakeItEasy" Version="8.1.0" />
<PackageReference Include="PCLMock" Version="5.1.3" />
<PackageReference Include="Rocks" Version="8.0.0" />
<PackageReference Include="System.IO.Abstractions" Version="20.0.4" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions BenchmarkMockNet/Benchmarks/Callback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ public override bool PCLMock()
public override bool Rocks()
{
var called = false;
var rock = Rock.Create<IThing>();
rock.Methods().DoSomething().Callback(() => called = true);
var chunk = rock.Instance();
chunk.DoSomething();
var expectations = new IThingCreateExpectations();
expectations.Methods.DoSomething().Callback(() => called = true);
var mock = expectations.Instance();
mock.DoSomething();
return called;
}
}
2 changes: 1 addition & 1 deletion BenchmarkMockNet/Benchmarks/Construction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ public override IThing JustMockLite()
public override IThing PCLMock() => new ThingMock();

[Benchmark]
public override IThing Rocks() => Rock.Create<IThing>().Instance();
public override IThing Rocks() => new IThingCreateExpectations().Instance();
}
8 changes: 4 additions & 4 deletions BenchmarkMockNet/Benchmarks/EmptyMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public override void PCLMock()
[Benchmark]
public override void Rocks()
{
var chunk = Rock.Create<IThing>();
chunk.Methods().DoNothing();
var rock = chunk.Instance();
rock.DoNothing();
var expectations = new IThingCreateExpectations();
expectations.Methods.DoNothing();
var mock = expectations.Instance();
mock.DoNothing();
}
}
8 changes: 4 additions & 4 deletions BenchmarkMockNet/Benchmarks/EmptyReturn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public override int PCLMock()
[Benchmark]
public override int Rocks()
{
var chunk = Rock.Create<IThing>();
chunk.Methods().Zero().Returns(0);
var rock = chunk.Instance();
return rock.Zero();
var expectations = new IThingCreateExpectations();
expectations.Methods.Zero().ReturnValue(0);
var mock = expectations.Instance();
return mock.Zero();
}
}
6 changes: 3 additions & 3 deletions BenchmarkMockNet/Benchmarks/OneParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public override void PCLMock()
[Benchmark]
public override void Rocks()
{
var rock = Rock.Create<IThing>();
rock.Methods().OneParameter(0);
rock.Instance().OneParameter(0);
var expectations = new IThingCreateExpectations();
expectations.Methods.OneParameter(0);
expectations.Instance().OneParameter(0);
}
}
6 changes: 3 additions & 3 deletions BenchmarkMockNet/Benchmarks/Return.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public override int PCLMock()
[Benchmark]
public override int Rocks()
{
var rock = Rock.Create<IThing>();
rock.Methods().One().Returns(1);
return rock.Instance().One();
var expectations = new IThingCreateExpectations();
expectations.Methods.One().ReturnValue(1);
return expectations.Instance().One();
}
}
8 changes: 4 additions & 4 deletions BenchmarkMockNet/Benchmarks/Verify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public override void PCLMock()
[Benchmark]
public override void Rocks()
{
var rock = Rock.Create<IThing>();
rock.Methods().DoSomething();
rock.Instance().DoSomething();
rock.Verify();
var expectations = new IThingCreateExpectations();
expectations.Methods.DoSomething();
expectations.Instance().DoSomething();
expectations.Verify();
}
}
4 changes: 4 additions & 0 deletions BenchmarkMockNet/Rocks/Mocks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using BenchmarkMockNet;
using Rocks;

[assembly: RockCreate<IThing>]

0 comments on commit 161bd76

Please sign in to comment.