AutoMoxture.XUnit
1.1.0
See the version list below for details.
dotnet add package AutoMoxture.XUnit --version 1.1.0
NuGet\Install-Package AutoMoxture.XUnit -Version 1.1.0
<PackageReference Include="AutoMoxture.XUnit" Version="1.1.0" />
paket add AutoMoxture.XUnit --version 1.1.0
#r "nuget: AutoMoxture.XUnit, 1.1.0"
// Install AutoMoxture.XUnit as a Cake Addin #addin nuget:?package=AutoMoxture.XUnit&version=1.1.0 // Install AutoMoxture.XUnit as a Cake Tool #tool nuget:?package=AutoMoxture.XUnit&version=1.1.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. |
.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)
- 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 | 262 | 11/12/2023 |
8.0.0 | 125 | 11/9/2023 |
7.4.1 | 149 | 10/23/2023 |
7.3.0 | 168 | 5/31/2023 |
7.2.0 | 152 | 5/28/2023 |
7.1.0 | 173 | 5/27/2023 |
7.0.3 | 159 | 5/26/2023 |
7.0.2 | 154 | 5/26/2023 |
7.0.1 | 158 | 5/26/2023 |
7.0.0 | 149 | 5/26/2023 |
4.0.3 | 166 | 5/26/2023 |
4.0.1 | 162 | 5/26/2023 |
4.0.0 | 155 | 5/26/2023 |
3.1.0 | 179 | 4/25/2023 |
3.0.3 | 182 | 4/18/2023 |
3.0.2 | 189 | 4/18/2023 |
3.0.0 | 164 | 4/18/2023 |
2.2.0 | 175 | 4/18/2023 |
2.1.3 | 196 | 4/18/2023 |
2.1.2 | 225 | 3/29/2023 |
2.1.1 | 192 | 3/29/2023 |
2.1.0 | 227 | 3/29/2023 |
2.0.0 | 253 | 2/7/2023 |
1.1.2 | 488 | 9/23/2022 |
1.1.1 | 473 | 9/23/2022 |
1.1.0 | 437 | 9/22/2022 |
1.0.0 | 428 | 9/22/2022 |