AUT.ConfigureTestProjects
5.2.5
See the version list below for details.
dotnet add package AUT.ConfigureTestProjects --version 5.2.5
NuGet\Install-Package AUT.ConfigureTestProjects -Version 5.2.5
<PackageReference Include="AUT.ConfigureTestProjects" Version="5.2.5" />
paket add AUT.ConfigureTestProjects --version 5.2.5
#r "nuget: AUT.ConfigureTestProjects, 5.2.5"
// Install AUT.ConfigureTestProjects as a Cake Addin #addin nuget:?package=AUT.ConfigureTestProjects&version=5.2.5 // Install AUT.ConfigureTestProjects as a Cake Tool #tool nuget:?package=AUT.ConfigureTestProjects&version=5.2.5
Introduction
This package contains generic helper method to configure any project. It doesn't contain any business logic.
AUT.TestProjects.GenerationVersion2
The next generation version of AUT Configure test projects. It will be used in future.
This package is specially designed to configure Generator(v0.2.4 above) Automatic Unit Tests. Still this package doesn't contain any business logic but generic method to create any kind of object regardless the business structure.
This package is downgraded (.NET4.5.2) and used specific versions (NUNit, Shouldly, Moq) that new test project usages.
Release Notes
- Initial release from existing version.
- Removed Generic Test case attribute.
- Converted project to .NET 4.5.2
- Removed unused methods.
- Restructured codebase.
- Fixture recursion level defined to 6.
- Nunit 3.10.1
Code Examples
Few sample code examples to use it in the bootstrapping.
Class Inherit Example
[TestFixture]
public class GenericTestClass : AbstractBaseSetupV1Test
{
// Initialize basic stuff in the base class.
public GenericTestClass() : base(type(ObjectTypeTesting))
{}
[Test]
public void TestMethodExample()
{
// Arrange
var anyType = this.CreateType<Type>();
var testingClassInstance = this.Create();
// Act
... Acting stuff.
// Assert
anyType.ShouldNotBeNull();
testingClassInstance.ShouldNotBeNull();
}
}
Explore function
Explore existing methods in the AbstractBaseSetupV2Test Extensions var methodInfo = this.GetMethodInfo("PrivateMethodName", defaultIndex: 0); // Provide overloading index if has any overloading. this.ExploreMethodDynamically(methodInfo); // Explore private mehtods.
Abstract Class Create Example
var exampleInstance = this.Create(); // inside AbstractBaseSetupV1Test class
Create Example from Base Class
var employee = CreateAnalyzer.CreateAbstractClass<AbstractEmployee>(typeof(EmployeeImpl), GenericTestClass.Fixture);
Get MethodInfo without throwing exception
var methodInfo1 = ReflectionAnalyzer.GetMethodInfo(typeof(T), "AnyMethodName"); // only if there is no overloading, no exception if any. Returns first one.
var methodInfo2 = ReflectionAnalyzer.GetMethodInfo(typeof(T), "AnyMethodName", new Type[] { typeof(MethodParameterType1) }); // Returns specific one by matching the parameters.
Reflection Instance Member Extensions Example MemberInfoExtension.cs
var value1 = memberInfo.GetValue(instance, Fixture); // get the value if property, field or method (by invoking it).
var value2 = memberInfo.GetValueWithoutParameters(instance); // get the value if property, field or method (by invoking it, assuming method doesn't have parameters).
var fieldInfo = memberInfo.ToField(); // get `FieldInfo` if it is or null.
var methodInfo = memberInfo.ToMethod(); // get `MethodInfo` if it is or null.
var propertyInfo = memberInfo.ToProperty(); // get `PropertyInfo` if it is or null.
Extensions Example of MethodInfoExtension.cs
var value1 = memberInfo.GetResultMethodInfo<TReturnData>(instance, out _, parameters); // invoke method and get typed result. And suppress exception.
var value2 = memberInfo.GetResultMethodInfo<TReturnData>(instance, parameters); // invoke method and get typed result. And suppress exception.
var value3 = memberInfo.GetResultOfStaticMethodInfo<TReturnData>(parameters); // invoke method and get typed result. And suppress exception.
var value3 = memberInfo.GetResultOfMethodInfoAsObject(parameters); // invoke method and get object result. And suppress exception.
var value3 = memberInfo.GetResultOfMethodInfoAsObjectWithParametersCreatedIfHasAny(instance, fixture); // Create parameters dynamically if has any and then invoke then method.
var doesThrow = memberInfo.DoesInvokeThrow<T>(instance, parameters); // returns true / false based on exception thrown.
var exception = memberInfo.GetThrownException(instance, parameters); // get thrown exception
Example of CreateAnalyzer.cs
var value1 = CreateAnalyzer.CreateType(fixture, type, out _, parameters = null); // try to create the object in different paths. With new(), with fixture, with constuctor (by creating all constuctor parameters using fixture)
var value2 = CreateAnalyzer.ReturnStaticSingletonInstance<T>(fixture); // get the actual singleton type.
var value3 = CreateAnalyzer.Create<T>(fixture, out _, useFixtureAtFirst, [parameters]); // try to create the object in different paths. With new(), with fixture, with constuctor (by creating all constuctor parameters using fixture)
var value3 = CreateAnalyzer.CreateAbstractClass<AbstractEmployee>(typeof(EmployeeImpl), GenericTestClass.Fixture); // create a abstract class from a list of child classes type.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- AutoFixture.AutoMoq (>= 4.5.0)
- AutoFixture.NUnit3 (>= 4.5.0)
- Moq (>= 4.9.0)
- NUnit (>= 3.10.1)
- Shouldly (>= 3.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 4.5.1)
- System.Threading.Tasks.Extensions (>= 4.5.1)
- System.ValueTuple (>= 4.5.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 |
---|---|---|
5.4.4 | 1,445 | 10/16/2018 |
5.4.3 | 1,208 | 10/4/2018 |
5.4.1 | 1,156 | 10/3/2018 |
5.4.0 | 2,217 | 9/29/2018 |
5.3.2 | 1,109 | 9/27/2018 |
5.3.0 | 1,061 | 9/27/2018 |
5.2.7 | 1,065 | 9/27/2018 |
5.2.6 | 1,091 | 9/27/2018 |
5.2.5.1 | 1,148 | 9/27/2018 |
5.2.5 | 1,073 | 9/27/2018 |
5.2.4 | 1,071 | 9/27/2018 |
5.2.3 | 1,065 | 9/27/2018 |
5.2.2 | 1,065 | 9/27/2018 |
5.2.1 | 1,095 | 9/27/2018 |
5.2.0 | 1,127 | 9/26/2018 |
5.0.0 | 1,040 | 9/26/2018 |
4.4.0 | 1,108 | 9/20/2018 |
4.3.3 | 4,048 | 8/31/2018 |
4.3.2 | 1,066 | 8/31/2018 |
4.3.1 | 1,874 | 8/23/2018 |
4.3.0 | 1,152 | 8/23/2018 |
4.2.6 | 1,273 | 8/19/2018 |
4.2.5 | 1,182 | 8/19/2018 |
4.2.4 | 1,122 | 8/19/2018 |
4.2.3 | 2,286 | 8/14/2018 |
4.2.2 | 1,375 | 8/9/2018 |
4.2.1 | 1,214 | 8/9/2018 |
4.2.0 | 1,236 | 8/8/2018 |
4.1.0 | 1,177 | 7/31/2018 |
4.0.0 | 1,119 | 7/31/2018 |
3.9.0 | 1,120 | 7/31/2018 |
3.8.0 | 1,173 | 7/31/2018 |
3.7.0 | 1,224 | 7/25/2018 |
3.6.0 | 1,148 | 7/25/2018 |
3.5.0 | 1,146 | 7/25/2018 |
3.4.0 | 1,232 | 7/18/2018 |
3.3.0 | 1,295 | 7/12/2018 |
3.2.0 | 1,284 | 7/12/2018 |
3.1.0 | 1,343 | 7/11/2018 |
3.0.0 | 1,340 | 7/11/2018 |
2.7.0 | 1,258 | 7/7/2018 |
2.6.0 | 1,228 | 7/7/2018 |
2.5.0 | 1,224 | 7/6/2018 |
2.4.0 | 1,219 | 7/6/2018 |
2.3.0 | 1,379 | 7/6/2018 |
2.2.0 | 1,348 | 7/6/2018 |
2.1.0 | 1,344 | 7/5/2018 |
2.0.0 | 1,369 | 7/4/2018 |
1.0.9 | 6,777 | 5/31/2018 |
1.0.8 | 1,319 | 5/31/2018 |
1.0.7 | 1,647 | 5/31/2018 |
1.0.6 | 1,391 | 5/31/2018 |
1.0.5 | 1,633 | 5/28/2018 |
1.0.4 | 2,251 | 5/21/2018 |
1.0.3 | 1,575 | 5/11/2018 |
1.0.2 | 1,279 | 5/10/2018 |
1.0.1 | 1,267 | 5/10/2018 |
1.0.0.9 | 1,301 | 5/10/2018 |
1.0.0.8 | 1,266 | 5/10/2018 |
1.0.0.7 | 1,149 | 5/10/2018 |
1.0.0.6 | 1,271 | 5/10/2018 |
1.0.0.5 | 1,241 | 5/10/2018 |
1.0.0.4 | 1,283 | 5/10/2018 |
1.0.0.3 | 1,258 | 5/10/2018 |
1.0.0.2 | 1,257 | 5/10/2018 |
1.0.0.1 | 1,290 | 5/10/2018 |
1.0.0 | 1,427 | 5/9/2018 |
AUT Engineering Team Project. Added explore functionality for increase coverage gain.
Fixed the critical issue, Explore Field method without generic argument
- We need to keep the explore field method with generic argument as it is.
- Added backwards compatibility with 2.7 and 1.0.9
- Added new methods with instance inject.
- Explore static method functionality fixed.
- Static methods can be called with or without instance.
- Static fixture moved to non-static version
- New Abstract class added for typed generics.
- Supported with Generator 0.2.2 - Backwards compatibality added with 4.4