The easy mocking library for .NET
Fake.Reset
replaces Fake.ClearConfiguration
as the preferred mechanism to clear existing fakes' configuration. (#1839)
Resets all changes made to the fake after it was created.EventRule
between Fakes (#1993)var capturedMessage = A.Captured<string>();
var logger = A.Fake<IListLogger>();
A.CallTo(() => logger.Log(capturedMessage._, An<IEnumerable<int>>._)).DoesNothing();
var calculator = new Calculator(logger);
calculator.Add([1, 2, 3, 4]);
calculator.Square(7);
capturedMessage.Values.Should().Equal("about to add", "about to square");
Upgrade Castle.Core to 5.1.1 (#1925)
Match enumerable arguments by comparing contents rather than via Equals (#1960)
This is technically a breaking change, but it's pretty unlikely that anyone was relying on the old behavior. Only if someone were passing an enumerable to a call specification and either
would it be an unwelcome surprise.
ArgumentEqualityComparer<T>
or implementing IArgumentEqualityComparer
. Learn more at Custom Argument Equality.in
parameter (#1948)NullReferenceException
thrown when attempting to build unmet expectation message that includes an anonymous parameter (#1920)ArgumentCollection.ArgumentNames
has type IEnumerable<string>
but may contain nulls (#1922)MustHaveHappend
→ MustHaveHappened
(#1904)https://github.com/FakeItEasy/FakeItEasy/compare/7.3.1....7.4.0
CallsWrappedMethod
doesn't add a call rule, so will not override Strict configuration (#1870)Full Changelog: https://github.com/FakeItEasy/FakeItEasy/compare/7.3.0...7.3.1
A.CollectionOfFake<ICollectionItem>(count, (options, i) => options.Named($"Item{i}")));
Sdk.Create.CollectionOfFake(typeof(ICollectionItem), count, (options, i) => options.Named($"Item{i}"));
A.CallTo(fake, EventAction.Add("EventName")) // Configure subscription to a specific event
A.CallTo(fake, EventAction.Remove("EventName")) // Configure unsubscription from a specific event
A.CallTo(fake, EventAction.Add()) // Configure subscription to any event
A.CallTo(fake, EventAction.Remove()) // Configure unsubscription from any event
Manage.Event("FellInLove").Of(robot);
Manage.AllEvents.Of(robot);
var fake = A.Fake<IFoo>(o => o.Strict(StrictFakeOptions.ManageEvents));