AutoMoxture.XUnit
1.0.0
See the version list below for details.
dotnet add package AutoMoxture.XUnit --version 1.0.0
NuGet\Install-Package AutoMoxture.XUnit -Version 1.0.0
<PackageReference Include="AutoMoxture.XUnit" Version="1.0.0" />
<PackageVersion Include="AutoMoxture.XUnit" Version="1.0.0" />
<PackageReference Include="AutoMoxture.XUnit" />
paket add AutoMoxture.XUnit --version 1.0.0
#r "nuget: AutoMoxture.XUnit, 1.0.0"
#:package AutoMoxture.XUnit@1.0.0
#addin nuget:?package=AutoMoxture.XUnit&version=1.0.0
#tool nuget:?package=AutoMoxture.XUnit&version=1.0.0
AutoMoxture
AutoMoxture provides a convenient base class to work with AutoFixture and AutoMoq so you can inherit all your test classes from it :
public class DemoServiceTests : AutoMoxtureTest<DemoService>
{
...
}
AutoMoxture will create and expose the Sut property out of the box :
public class DemoServiceTests : AutoMoxtureTest<DemoService>
{
...
// Act
var response = Sut.DemoMethod();
...
}
AutoMoxture also inherits from AutoFixture.Fixture so AutoFixture methods are directly accessible :
public class DemoServiceTests : AutoMoxtureTest<DemoService>
{
...
// Create a string
string lastName = Create<string>();
// Create multiple strings
IEnumerable<string> multipleLastNames = CreateMany<string>();
// Instruct AutoFixture to always return the same string in the future
string frozenLastName = Freeze<string>();
// Create a custom builder for the class People
var peopleBuilder = Build<People>().With(b => b.LastName, "Cool Last Name");
...
}
AutoMoxture also introduces an alias method Mock<T> to quickly freeze a Mock :
public class DemoServiceTests : AutoMoxtureTest<DemoService>
{
...
// Regular way to freeze a Mock
var mockOfDependency = Freeze<Mock<IDependencyOfDemoService>>();
// Shorter way to freeze a Mock
var mockOfDependency = Mock<IDependencyOfDemoService>()
...
}
It is possible to customize the Fixture in your constructor.
public class DemoServiceTests : AutoMoxtureTest
{
public class DemoServiceTests()
{
Customize<TheTypeToCustomize>(c => c.FromFactory(new MethodInvoker(new GreedyConstructorQuery())));
}
}
This will apply to all the tests in the class. If you don't want this behavior, call the Customize method directly inside your test method.
public class DemoServiceTests : AutoMoxtureTest
{
public void Test1()
{
...
Customize<TheTypeToCustomize>(c => c.FromFactory(new MethodInvoker(new GreedyConstructorQuery())));
...
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- AutoFixture.AutoMoq (>= 4.17.0)
- StyleCop.Analyzers (>= 1.1.118)
- System.ComponentModel.TypeConverter (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.0.1 | 375 | 11/12/2023 |
| 8.0.0 | 209 | 11/9/2023 |
| 7.4.1 | 267 | 10/23/2023 |
| 7.3.0 | 311 | 5/31/2023 |
| 7.2.0 | 304 | 5/28/2023 |
| 7.1.0 | 300 | 5/27/2023 |
| 7.0.3 | 292 | 5/26/2023 |
| 7.0.2 | 301 | 5/26/2023 |
| 7.0.1 | 314 | 5/26/2023 |
| 7.0.0 | 287 | 5/26/2023 |
| 4.0.3 | 307 | 5/26/2023 |
| 4.0.1 | 285 | 5/26/2023 |
| 4.0.0 | 286 | 5/26/2023 |
| 3.1.0 | 304 | 4/25/2023 |
| 3.0.3 | 343 | 4/18/2023 |
| 3.0.2 | 367 | 4/18/2023 |
| 3.0.0 | 313 | 4/18/2023 |
| 2.2.0 | 325 | 4/18/2023 |
| 2.1.3 | 307 | 4/18/2023 |
| 1.0.0 | 577 | 9/22/2022 |