AUT.ConfigureTestProjects 5.2.5

There is a newer version of this package available.
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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AUT.ConfigureTestProjects" Version="5.2.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AUT.ConfigureTestProjects --version 5.2.5
#r "nuget: AUT.ConfigureTestProjects, 5.2.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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,383 10/16/2018
5.4.3 1,164 10/4/2018
5.4.1 1,110 10/3/2018
5.4.0 2,169 9/29/2018
5.3.2 1,061 9/27/2018
5.3.0 1,001 9/27/2018
5.2.7 1,016 9/27/2018
5.2.6 1,040 9/27/2018
5.2.5.1 1,104 9/27/2018
5.2.5 1,034 9/27/2018
5.2.4 1,032 9/27/2018
5.2.3 1,020 9/27/2018
5.2.2 1,021 9/27/2018
5.2.1 1,054 9/27/2018
5.2.0 1,085 9/26/2018
5.0.0 994 9/26/2018
4.4.0 1,062 9/20/2018
4.3.3 3,995 8/31/2018
4.3.2 1,025 8/31/2018
4.3.1 1,829 8/23/2018
4.3.0 1,108 8/23/2018
4.2.6 1,227 8/19/2018
4.2.5 1,139 8/19/2018
4.2.4 1,082 8/19/2018
4.2.3 2,243 8/14/2018
4.2.2 1,329 8/9/2018
4.2.1 1,174 8/9/2018
4.2.0 1,196 8/8/2018
4.1.0 1,135 7/31/2018
4.0.0 1,083 7/31/2018
3.9.0 1,083 7/31/2018
3.8.0 1,134 7/31/2018
3.7.0 1,184 7/25/2018
3.6.0 1,111 7/25/2018
3.5.0 1,112 7/25/2018
3.4.0 1,196 7/18/2018
3.3.0 1,257 7/12/2018
3.2.0 1,243 7/12/2018
3.1.0 1,297 7/11/2018
3.0.0 1,302 7/11/2018
2.7.0 1,215 7/7/2018
2.6.0 1,188 7/7/2018
2.5.0 1,184 7/6/2018
2.4.0 1,183 7/6/2018
2.3.0 1,343 7/6/2018
2.2.0 1,303 7/6/2018
2.1.0 1,309 7/5/2018
2.0.0 1,314 7/4/2018
1.0.9 6,731 5/31/2018
1.0.8 1,278 5/31/2018
1.0.7 1,608 5/31/2018
1.0.6 1,358 5/31/2018
1.0.5 1,601 5/28/2018
1.0.4 2,211 5/21/2018
1.0.3 1,528 5/11/2018
1.0.2 1,242 5/10/2018
1.0.1 1,232 5/10/2018
1.0.0.9 1,250 5/10/2018
1.0.0.8 1,228 5/10/2018
1.0.0.7 1,107 5/10/2018
1.0.0.6 1,235 5/10/2018
1.0.0.5 1,208 5/10/2018
1.0.0.4 1,239 5/10/2018
1.0.0.3 1,225 5/10/2018
1.0.0.2 1,220 5/10/2018
1.0.0.1 1,257 5/10/2018
1.0.0 1,378 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