github FakeItEasy/FakeItEasy 7.1.0

latest releases: 8.2.0, 8.1.0, 8.0.1...
2 years ago

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)
    1. 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
    2. Allow the user to explicitly enable the default event behavior
      Manage.Event("FellInLove").Of(robot);
      Manage.AllEvents.Of(robot);
    3. Allow the user to create strict fakes that still manage events automatically
      var fake = A.Fake<IFoo>(o => o.Strict(StrictFakeOptions.ManageEvents));

Additional Items

  • Improve Dummies documentation page (#1834, #1835)
  • Re-enable and fix integration test in net461 (#1843)

With special thanks for contributions to this release from:

Don't miss a new FakeItEasy release

NewReleases is sending notifications on new releases.