ObjectToTest 0.0.9
dotnet add package ObjectToTest --version 0.0.9
NuGet\Install-Package ObjectToTest -Version 0.0.9
<PackageReference Include="ObjectToTest" Version="0.0.9" />
<PackageVersion Include="ObjectToTest" Version="0.0.9" />
<PackageReference Include="ObjectToTest" />
paket add ObjectToTest --version 0.0.9
#r "nuget: ObjectToTest, 0.0.9"
#addin nuget:?package=ObjectToTest&version=0.0.9
#tool nuget:?package=ObjectToTest&version=0.0.9
ObjectToTest
<h3 align="center">
The main idea is to implement an extension method for C# objects that generates initialization piece of code depending on an object internal state and public constructors methods and properties. It should let the developer easily recreate an object state and continue using it in unit test environment.
public class Foo
{
public Foo(IPrice price, IUser user)
{
_price = price;
_user = user;
}
public void DoSomething(int argument)
{
// Some logic
}
}
Let's say there is a class <b>Foo</b> in a project. It would be really nice to have an extension method which will generate a piece of code that will allow to recreate the same object with the same internal state.
public void SomeMethod(Foo foo)
{
/*
* The result of ToUnit method should be a string that contains the peice of code to recreate
* foo object from the scatch.
* new Foo(new Price(10), new User("userName"));
*/
var tests = foo.ToTest();
}
This generated code can be easily insterted into Unit Test.
Object state recreation diagram
The diagram shows an algorithm that an object uses uses to recreate itself with initiated internal state. The interesting thing is that an object can have arguments which are reused in other objects. Such objects are called Shared Arguments.
More details about project architecture can be found on wiki page
IL Decompilator
IL Spy nuget package is used to support c# code decompilation
Build status
<div align="center">
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 is compatible. |
.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
- ICSharpCode.Decompiler (>= 7.2.1.6856)
-
.NETStandard 2.1
- ICSharpCode.Decompiler (>= 7.2.1.6856)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.