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,434 10/16/2018
5.4.3 1,194 10/4/2018
5.4.1 1,145 10/3/2018
5.4.0 2,207 9/29/2018
5.3.2 1,100 9/27/2018
5.3.0 1,050 9/27/2018
5.2.7 1,056 9/27/2018
5.2.6 1,082 9/27/2018
5.2.5.1 1,139 9/27/2018
5.2.5 1,064 9/27/2018
5.2.4 1,062 9/27/2018
5.2.3 1,056 9/27/2018
5.2.2 1,056 9/27/2018
5.2.1 1,086 9/27/2018
5.2.0 1,118 9/26/2018
5.0.0 1,031 9/26/2018
4.4.0 1,098 9/20/2018
4.3.3 4,038 8/31/2018
4.3.2 1,057 8/31/2018
4.3.1 1,863 8/23/2018
4.3.0 1,142 8/23/2018
4.2.6 1,264 8/19/2018
4.2.5 1,173 8/19/2018
4.2.4 1,113 8/19/2018
4.2.3 2,277 8/14/2018
4.2.2 1,365 8/9/2018
4.2.1 1,205 8/9/2018
4.2.0 1,226 8/8/2018
4.1.0 1,169 7/31/2018
4.0.0 1,111 7/31/2018
3.9.0 1,112 7/31/2018
3.8.0 1,165 7/31/2018
3.7.0 1,216 7/25/2018
3.6.0 1,140 7/25/2018
3.5.0 1,138 7/25/2018
3.4.0 1,224 7/18/2018
3.3.0 1,285 7/12/2018
3.2.0 1,276 7/12/2018
3.1.0 1,335 7/11/2018
3.0.0 1,332 7/11/2018
2.7.0 1,250 7/7/2018
2.6.0 1,220 7/7/2018
2.5.0 1,216 7/6/2018
2.4.0 1,211 7/6/2018
2.3.0 1,371 7/6/2018
2.2.0 1,340 7/6/2018
2.1.0 1,336 7/5/2018
2.0.0 1,361 7/4/2018
1.0.9 6,767 5/31/2018
1.0.8 1,311 5/31/2018
1.0.7 1,639 5/31/2018
1.0.6 1,383 5/31/2018
1.0.5 1,625 5/28/2018
1.0.4 2,243 5/21/2018
1.0.3 1,567 5/11/2018
1.0.2 1,271 5/10/2018
1.0.1 1,259 5/10/2018
1.0.0.9 1,293 5/10/2018
1.0.0.8 1,256 5/10/2018
1.0.0.7 1,141 5/10/2018
1.0.0.6 1,263 5/10/2018
1.0.0.5 1,233 5/10/2018
1.0.0.4 1,275 5/10/2018
1.0.0.3 1,250 5/10/2018
1.0.0.2 1,249 5/10/2018
1.0.0.1 1,282 5/10/2018
1.0.0 1,419 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