Releases: FakeItEasy/FakeItEasy
Releases · FakeItEasy/FakeItEasy
8.2.0
New
Fake.Reset
replacesFake.ClearConfiguration
as the preferred mechanism to clear existing fakes' configuration. (#1839)
Resets all changes made to the fake after it was created.- net8.0 target framework assembly (#1996)
Fixed
- Creation failure message may indicate that the to-be-faked type has no applicable constructor when it really does (#1929)
Additional Items
- Stop resigning FakeItEasy.Tests.TestHelpers.FSharp once the SDK starts signing it properly (#1930)
- Share
EventRule
between Fakes (#1993) - Update Github actions to quell build warnings (#1995)
- Bump documentation-building dependencies (#1985)
- Bump FakeItEasy.Tools to support release process (#1998, #1999)
- Bump dawidd6/action-download-artifact to quell Node.js version warning (#1999)
8.1.0
Changed
New
- Provide a mechanism for capturing arguments passed to Fakes (#1950):
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");
Fixed
- Argument matchers trigger even if the rule they're part of has already fired the maximum number of times (#1975)
Additional Items
- Upgrade StyleCop (#1979)
- Suppress NU1902,NU1903 in tests, recipes (#1981)
- Include README in NuGet package (#1980)
With special thanks for contributions to this release from:
- Søren Palmund - @Miista
8.0.1
Fixed
DoesNothing
and implicit creation options throwsArgumentException
(#1976)
Additional Items
With special thanks for contributions to this release from:
- Alexander Kastler - @Spacelord-XaN
8.0.0
Changed
-
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
- relying on the reference equality to fail, or
- the argument's type has overridden Equals with an implementation that does not compare the sequence item-by-item as we propose to do
would it be an unwelcome surprise.
Removed
- net5.0 target framework assembly (#1936)
New
- net6.0 target framework assembly (#1936)
- Registry of argument comparers (#1952, #1961)
Discoverable argument comparers can be implemented by deriving fromArgumentEqualityComparer<T>
or implementingIArgumentEqualityComparer
. Learn more at Custom Argument Equality. - Match enumerable arguments by comparing contents rather than via Equals (#1960)
Fixed
- Failure to create fake via constructor with
in
parameter (#1948) - Nesting or compounding An-built constraints throws wrong exception (#1966)
Additional Items
- Publish target framework Support Policy (#1935)
- Escape HTML tags in Formatting Argument Values docs (#1955)
- Fix broken link in documentation (#1956)
- Various docs-generating dependency updates, suggested by dependabot for security (#1945, #1954, #1959, #1971)
- Wrong account making "This change has been released" notes on issues (#1933)
- Cause "👀 publish-docs-preview" label to publish docs preview for a pull request (#1939, #1941, #1942, #1943)
- Install .NET Core 3.1 on Windows in CI (#1954)
With special thanks for contributions to this release from:
- first-time contributor Viktor Hofer - @ViktorHofer (#1925)
- @mriehm
8.0.0-alpha.1
Changed
Upgrade Castle.Core to 5.1.1 (#1925)
With special thanks for contributions to this release from:
- first-time contributor Viktor Hofer - @ViktorHofer (#1925)
7.4.0
New
- Ensure anonymous parameters are handled and displayed correctly in all cases (#1928)
Fixed
NullReferenceException
thrown when attempting to build unmet expectation message that includes an anonymous parameter (#1920)ArgumentCollection.ArgumentNames
has typeIEnumerable<string>
but may contain nulls (#1922)- Provide placeholder names for anonymous parameters in received call description (#1924)
Additional Items
- Fix typo in Assertions documentation:
MustHaveHappend
→MustHaveHappened
(#1904) - Migrate documentation from Read the Docs to the FakeItEasy website.
The documentation is built using Material for Mkdocs and versions are maintained by mike:- Upgrade mkdocs to 1.3.0 (#1877)
- Build docs on each pull request (#1878)
- Update the "Analyzers" article to redirect to the moved analyzers docs (#1886)
- Build docs with Material for MkDocs and mike (#1896)
- Fix link in README to point to the new docs and remove readthedocs.yml (#1899)
- Lock down python requirements (#1908)
- Upgrade mkdocs-material to 9.1.3 (#1916)
- Add Faking HttpClient recipe (#1915, #1918)
- Replace examples projects with documentation or recipes (#1917)
- Test against .NET 6.0 (#1876, #1914)
- Use GitHub Actions for CI (#1892, #1909, #1911)
- Fix pack build target to support spaces in path (#1895)
- Replace ApprovalTests with Verify (#1891)
- Explain default argument formatting before how to customize (#1902)
- Improve in-article tables of contents (#1907)
With special thanks for contributions to this release from:
- 🥇 Andrei Chasovskikh - @andreycha (#1904)
- 🥇 Kai - @kaeedo (#1920)
Full Changelog
7.3.1
Fixed
CallsWrappedMethod
doesn't add a call rule, so will not override Strict configuration (#1870)
Additional Items
Full Changelog: 7.3.0...7.3.1
7.3.0
New
- Indicate Fake name (if defined) in failing assertions (#1837)
Additional Items
- Fix warnings introduced by .NET 6.0 SDK and use latest AppVeyor images (#1860)
- Use CallerArgumentExpression in Guard.AgainstNull (#1861)
- Bump mkdocs from 1.0.4 to 1.2.3 in /docs (#1863)
- Remove ExpressionCallMatcherTests (#1865)
- Add sample usage to README (#1862)
With special thanks for contributions to this release from:
- PiotrKlecha - @PiotrKlecha
- Dependabot - @dependabot
7.2.0
New
- Improve speed of Object method comparisons when applying default Fake rules (#1848)
Fixed
- Overridden Equals on wrapping Fake causes call to be forwarded to wrapped object (#1849)
- StrictFakeOptions.Allow* do not apply to overridden Object methods (#1850)
Additional Items
- Update @afakebot's personal authentication token on AppVeyor (#1846)
- Fix minor typo in StrictFakeOptions.AllowEvents API docs (#1851)
- Clarify use of WithArgumentsForConstructor expression (#1855)
With special thanks for contributions to this release from:
- Tim Lovell-Smith - @TimLovellSmith
7.1.0
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)