New
- Add CollectionOfFake overload that accepts an action that uses fake number to configure fake (#1838)
A.CollectionOfFake<ICollectionItem>(count, (options, i) => options.Named($"Item{i}"))); Sdk.Create.CollectionOfFake(typeof(ICollectionItem), count, (options, i) => options.Named($"Item{i}"));
- Improve the API for events (#1841)
- Add a new overload of A.CallTo that accepts an EventAction
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
- Allow the user to explicitly enable the default event behavior
Manage.Event("FellInLove").Of(robot); Manage.AllEvents.Of(robot);
- Allow the user to create strict fakes that still manage events automatically
var fake = A.Fake<IFoo>(o => o.Strict(StrictFakeOptions.ManageEvents));
- Add a new overload of A.CallTo that accepts an EventAction
Additional Items
- Improve Dummies documentation page (#1834, #1835)
- Re-enable and fix integration test in net461 (#1843)