Fixed tests
This commit is contained in:
Родитель
0eead3598f
Коммит
776d81aedf
|
@ -1,12 +1,12 @@
|
|||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionBase>5.10.3</VersionBase>
|
||||
<VersionBase>5.11.0</VersionBase>
|
||||
<PackageReleaseNotes>This package is compatible with .NET Standard 1.0 and 2.0, .NET Core 1.0 and 2.0, .NET 4.0, 4.5, 4.6, 4.7</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<UnityAbstractionsVersion>4.1.*</UnityAbstractionsVersion>
|
||||
<UnityAbstractionsVersion>5.11.*</UnityAbstractionsVersion>
|
||||
<TargetFrameworks>netstandard2.0;netstandard1.0;netcoreapp2.0;netcoreapp1.0;net47;net46;net45;net40</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -0,0 +1,467 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Runner.Setup;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Unity;
|
||||
|
||||
namespace Performance.Tests
|
||||
{
|
||||
[BenchmarkCategory("Basic")]
|
||||
[Config(typeof(BenchmarkConfiguration))]
|
||||
public class BasicBase
|
||||
{
|
||||
protected IUnityContainer _container;
|
||||
protected object[] _storage = new object[20];
|
||||
private object foo = new Foo();
|
||||
|
||||
public virtual void SetupContainer()
|
||||
{
|
||||
_container.RegisterType<PocoWithDependency00>();
|
||||
_container.RegisterType<PocoWithDependency01>();
|
||||
_container.RegisterType<PocoWithDependency02>();
|
||||
_container.RegisterType<PocoWithDependency03>();
|
||||
_container.RegisterType<PocoWithDependency04>();
|
||||
_container.RegisterType<PocoWithDependency05>();
|
||||
_container.RegisterType<PocoWithDependency06>();
|
||||
_container.RegisterType<PocoWithDependency07>();
|
||||
_container.RegisterType<PocoWithDependency08>();
|
||||
_container.RegisterType<PocoWithDependency09>();
|
||||
_container.RegisterType<PocoWithDependency10>();
|
||||
_container.RegisterType<PocoWithDependency11>();
|
||||
_container.RegisterType<PocoWithDependency12>();
|
||||
_container.RegisterType<PocoWithDependency13>();
|
||||
_container.RegisterType<PocoWithDependency14>();
|
||||
_container.RegisterType<PocoWithDependency15>();
|
||||
_container.RegisterType<PocoWithDependency16>();
|
||||
_container.RegisterType<PocoWithDependency17>();
|
||||
_container.RegisterType<PocoWithDependency18>();
|
||||
_container.RegisterType<PocoWithDependency19>();
|
||||
|
||||
_container.RegisterType<IFoo00, Foo00>();
|
||||
_container.RegisterType<IFoo01, Foo01>();
|
||||
_container.RegisterType<IFoo02, Foo02>();
|
||||
_container.RegisterType<IFoo03, Foo03>();
|
||||
_container.RegisterType<IFoo04, Foo04>();
|
||||
_container.RegisterType<IFoo05, Foo05>();
|
||||
_container.RegisterType<IFoo06, Foo06>();
|
||||
_container.RegisterType<IFoo07, Foo07>();
|
||||
_container.RegisterType<IFoo08, Foo08>();
|
||||
_container.RegisterType<IFoo09, Foo09>();
|
||||
_container.RegisterType<IFoo10, Foo10>();
|
||||
_container.RegisterType<IFoo11, Foo11>();
|
||||
_container.RegisterType<IFoo12, Foo12>();
|
||||
_container.RegisterType<IFoo13, Foo13>();
|
||||
_container.RegisterType<IFoo14, Foo14>();
|
||||
_container.RegisterType<IFoo15, Foo15>();
|
||||
_container.RegisterType<IFoo16, Foo16>();
|
||||
_container.RegisterType<IFoo17, Foo17>();
|
||||
_container.RegisterType<IFoo18, Foo18>();
|
||||
_container.RegisterType<IFoo19, Foo19>();
|
||||
|
||||
_container.RegisterType<IFoo00, Foo00>("1");
|
||||
_container.RegisterType<IFoo01, Foo01>("1");
|
||||
_container.RegisterType<IFoo02, Foo02>("1");
|
||||
_container.RegisterType<IFoo03, Foo03>("1");
|
||||
_container.RegisterType<IFoo04, Foo04>("1");
|
||||
_container.RegisterType<IFoo05, Foo05>("1");
|
||||
_container.RegisterType<IFoo06, Foo06>("1");
|
||||
_container.RegisterType<IFoo07, Foo07>("1");
|
||||
_container.RegisterType<IFoo08, Foo08>("1");
|
||||
_container.RegisterType<IFoo09, Foo09>("1");
|
||||
_container.RegisterType<IFoo10, Foo10>("1");
|
||||
_container.RegisterType<IFoo11, Foo11>("1");
|
||||
_container.RegisterType<IFoo12, Foo12>("1");
|
||||
_container.RegisterType<IFoo13, Foo13>("1");
|
||||
_container.RegisterType<IFoo14, Foo14>("1");
|
||||
_container.RegisterType<IFoo15, Foo15>("1");
|
||||
_container.RegisterType<IFoo16, Foo16>("1");
|
||||
_container.RegisterType<IFoo17, Foo17>("1");
|
||||
_container.RegisterType<IFoo18, Foo18>("1");
|
||||
_container.RegisterType<IFoo19, Foo19>("1");
|
||||
|
||||
_container.RegisterFactory<IFoo00>("2", c => new Foo00());
|
||||
_container.RegisterFactory<IFoo01>("2", c => new Foo01());
|
||||
_container.RegisterFactory<IFoo02>("2", c => new Foo02());
|
||||
_container.RegisterFactory<IFoo03>("2", c => new Foo03());
|
||||
_container.RegisterFactory<IFoo04>("2", c => new Foo04());
|
||||
_container.RegisterFactory<IFoo05>("2", c => new Foo05());
|
||||
_container.RegisterFactory<IFoo06>("2", c => new Foo06());
|
||||
_container.RegisterFactory<IFoo07>("2", c => new Foo07());
|
||||
_container.RegisterFactory<IFoo08>("2", c => new Foo08());
|
||||
_container.RegisterFactory<IFoo09>("2", c => new Foo09());
|
||||
_container.RegisterFactory<IFoo10>("2", c => new Foo10());
|
||||
_container.RegisterFactory<IFoo11>("2", c => new Foo11());
|
||||
_container.RegisterFactory<IFoo12>("2", c => new Foo12());
|
||||
_container.RegisterFactory<IFoo13>("2", c => new Foo13());
|
||||
_container.RegisterFactory<IFoo14>("2", c => new Foo14());
|
||||
_container.RegisterFactory<IFoo15>("2", c => new Foo15());
|
||||
_container.RegisterFactory<IFoo16>("2", c => new Foo16());
|
||||
_container.RegisterFactory<IFoo17>("2", c => new Foo17());
|
||||
_container.RegisterFactory<IFoo18>("2", c => new Foo18());
|
||||
_container.RegisterFactory<IFoo19>("2", c => new Foo19());
|
||||
|
||||
_container.RegisterType(typeof(IFoo00<>), typeof(Foo00<>));
|
||||
_container.RegisterType(typeof(IFoo01<>), typeof(Foo01<>));
|
||||
_container.RegisterType(typeof(IFoo02<>), typeof(Foo02<>));
|
||||
_container.RegisterType(typeof(IFoo03<>), typeof(Foo03<>));
|
||||
_container.RegisterType(typeof(IFoo04<>), typeof(Foo04<>));
|
||||
_container.RegisterType(typeof(IFoo05<>), typeof(Foo05<>));
|
||||
_container.RegisterType(typeof(IFoo06<>), typeof(Foo06<>));
|
||||
_container.RegisterType(typeof(IFoo07<>), typeof(Foo07<>));
|
||||
_container.RegisterType(typeof(IFoo08<>), typeof(Foo08<>));
|
||||
_container.RegisterType(typeof(IFoo09<>), typeof(Foo09<>));
|
||||
_container.RegisterType(typeof(IFoo10<>), typeof(Foo10<>));
|
||||
_container.RegisterType(typeof(IFoo11<>), typeof(Foo11<>));
|
||||
_container.RegisterType(typeof(IFoo12<>), typeof(Foo12<>));
|
||||
_container.RegisterType(typeof(IFoo13<>), typeof(Foo13<>));
|
||||
_container.RegisterType(typeof(IFoo14<>), typeof(Foo14<>));
|
||||
_container.RegisterType(typeof(IFoo15<>), typeof(Foo15<>));
|
||||
_container.RegisterType(typeof(IFoo16<>), typeof(Foo16<>));
|
||||
_container.RegisterType(typeof(IFoo17<>), typeof(Foo17<>));
|
||||
_container.RegisterType(typeof(IFoo18<>), typeof(Foo18<>));
|
||||
_container.RegisterType(typeof(IFoo19<>), typeof(Foo19<>));
|
||||
|
||||
_container.RegisterInstance(typeof(IFoo<Foo00>), new Foo<Foo00>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo01>), new Foo<Foo01>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo02>), new Foo<Foo02>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo03>), new Foo<Foo03>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo04>), new Foo<Foo04>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo05>), new Foo<Foo05>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo06>), new Foo<Foo06>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo07>), new Foo<Foo07>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo08>), new Foo<Foo08>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo09>), new Foo<Foo09>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo10>), new Foo<Foo10>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo11>), new Foo<Foo11>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo12>), new Foo<Foo12>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo13>), new Foo<Foo13>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo14>), new Foo<Foo14>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo15>), new Foo<Foo15>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo16>), new Foo<Foo16>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo17>), new Foo<Foo17>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo18>), new Foo<Foo18>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo19>), new Foo<Foo19>());
|
||||
|
||||
|
||||
_container.RegisterInstance(new Foo<object>());
|
||||
_container.RegisterType(typeof(IFoo<object>), typeof(Foo<object>));
|
||||
|
||||
_container.RegisterFactory<IFoo>(c => foo);
|
||||
_container.RegisterType<IFoo, Foo>( "1");
|
||||
_container.RegisterType<PocoWithDependency>();
|
||||
_container.RegisterType(typeof(IFoo<>), typeof(Foo<>));
|
||||
}
|
||||
|
||||
public virtual object UnityContainer()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[01] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[02] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[03] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[04] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[05] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[06] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[07] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[08] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[09] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[10] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[11] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[12] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[13] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[14] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[15] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[16] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[17] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[18] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
_storage[19] = _container.Resolve(typeof(IUnityContainer), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object UnityContainerAsync()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[01] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[02] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[03] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[04] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[05] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[06] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[07] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[08] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[09] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[10] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[11] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[12] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[13] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[14] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[15] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[16] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[17] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[18] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
_storage[19] = _container.Resolve(typeof(IUnityContainerAsync), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object Unregistered()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(Poco00), null);
|
||||
_storage[01] = _container.Resolve(typeof(Poco01), null);
|
||||
_storage[02] = _container.Resolve(typeof(Poco02), null);
|
||||
_storage[03] = _container.Resolve(typeof(Poco03), null);
|
||||
_storage[04] = _container.Resolve(typeof(Poco04), null);
|
||||
_storage[05] = _container.Resolve(typeof(Poco05), null);
|
||||
_storage[06] = _container.Resolve(typeof(Poco06), null);
|
||||
_storage[07] = _container.Resolve(typeof(Poco07), null);
|
||||
_storage[08] = _container.Resolve(typeof(Poco08), null);
|
||||
_storage[09] = _container.Resolve(typeof(Poco09), null);
|
||||
_storage[10] = _container.Resolve(typeof(Poco10), null);
|
||||
_storage[11] = _container.Resolve(typeof(Poco11), null);
|
||||
_storage[12] = _container.Resolve(typeof(Poco12), null);
|
||||
_storage[13] = _container.Resolve(typeof(Poco13), null);
|
||||
_storage[14] = _container.Resolve(typeof(Poco14), null);
|
||||
_storage[15] = _container.Resolve(typeof(Poco15), null);
|
||||
_storage[16] = _container.Resolve(typeof(Poco16), null);
|
||||
_storage[17] = _container.Resolve(typeof(Poco17), null);
|
||||
_storage[18] = _container.Resolve(typeof(Poco18), null);
|
||||
_storage[19] = _container.Resolve(typeof(Poco19), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object Transient()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(PocoWithDependency00), null);
|
||||
_storage[01] = _container.Resolve(typeof(PocoWithDependency01), null);
|
||||
_storage[02] = _container.Resolve(typeof(PocoWithDependency02), null);
|
||||
_storage[03] = _container.Resolve(typeof(PocoWithDependency03), null);
|
||||
_storage[04] = _container.Resolve(typeof(PocoWithDependency04), null);
|
||||
_storage[05] = _container.Resolve(typeof(PocoWithDependency05), null);
|
||||
_storage[06] = _container.Resolve(typeof(PocoWithDependency06), null);
|
||||
_storage[07] = _container.Resolve(typeof(PocoWithDependency07), null);
|
||||
_storage[08] = _container.Resolve(typeof(PocoWithDependency08), null);
|
||||
_storage[09] = _container.Resolve(typeof(PocoWithDependency09), null);
|
||||
_storage[10] = _container.Resolve(typeof(PocoWithDependency10), null);
|
||||
_storage[11] = _container.Resolve(typeof(PocoWithDependency11), null);
|
||||
_storage[12] = _container.Resolve(typeof(PocoWithDependency12), null);
|
||||
_storage[13] = _container.Resolve(typeof(PocoWithDependency13), null);
|
||||
_storage[14] = _container.Resolve(typeof(PocoWithDependency14), null);
|
||||
_storage[15] = _container.Resolve(typeof(PocoWithDependency15), null);
|
||||
_storage[16] = _container.Resolve(typeof(PocoWithDependency16), null);
|
||||
_storage[17] = _container.Resolve(typeof(PocoWithDependency17), null);
|
||||
_storage[18] = _container.Resolve(typeof(PocoWithDependency18), null);
|
||||
_storage[19] = _container.Resolve(typeof(PocoWithDependency19), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object Mapping()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IFoo00), null);
|
||||
_storage[01] = _container.Resolve(typeof(IFoo01), null);
|
||||
_storage[02] = _container.Resolve(typeof(IFoo02), null);
|
||||
_storage[03] = _container.Resolve(typeof(IFoo03), null);
|
||||
_storage[04] = _container.Resolve(typeof(IFoo04), null);
|
||||
_storage[05] = _container.Resolve(typeof(IFoo05), null);
|
||||
_storage[06] = _container.Resolve(typeof(IFoo06), null);
|
||||
_storage[07] = _container.Resolve(typeof(IFoo07), null);
|
||||
_storage[08] = _container.Resolve(typeof(IFoo08), null);
|
||||
_storage[09] = _container.Resolve(typeof(IFoo09), null);
|
||||
_storage[10] = _container.Resolve(typeof(IFoo10), null);
|
||||
_storage[11] = _container.Resolve(typeof(IFoo11), null);
|
||||
_storage[12] = _container.Resolve(typeof(IFoo12), null);
|
||||
_storage[13] = _container.Resolve(typeof(IFoo13), null);
|
||||
_storage[14] = _container.Resolve(typeof(IFoo14), null);
|
||||
_storage[15] = _container.Resolve(typeof(IFoo15), null);
|
||||
_storage[16] = _container.Resolve(typeof(IFoo16), null);
|
||||
_storage[17] = _container.Resolve(typeof(IFoo17), null);
|
||||
_storage[18] = _container.Resolve(typeof(IFoo18), null);
|
||||
_storage[19] = _container.Resolve(typeof(IFoo19), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object MappingToSingleton()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[01] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[02] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[03] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[04] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[05] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[06] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[07] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[08] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[09] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[10] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[11] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[12] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[13] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[14] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[15] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[16] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[17] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[18] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
_storage[19] = _container.Resolve(typeof(IFoo<object>), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object GenericInterface()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IFoo00<IFoo00>), null);
|
||||
_storage[01] = _container.Resolve(typeof(IFoo01<IFoo01>), null);
|
||||
_storage[02] = _container.Resolve(typeof(IFoo02<IFoo02>), null);
|
||||
_storage[03] = _container.Resolve(typeof(IFoo03<IFoo03>), null);
|
||||
_storage[04] = _container.Resolve(typeof(IFoo04<IFoo04>), null);
|
||||
_storage[05] = _container.Resolve(typeof(IFoo05<IFoo05>), null);
|
||||
_storage[06] = _container.Resolve(typeof(IFoo06<IFoo06>), null);
|
||||
_storage[07] = _container.Resolve(typeof(IFoo07<IFoo07>), null);
|
||||
_storage[08] = _container.Resolve(typeof(IFoo08<IFoo08>), null);
|
||||
_storage[09] = _container.Resolve(typeof(IFoo09<IFoo09>), null);
|
||||
_storage[10] = _container.Resolve(typeof(IFoo10<IFoo10>), null);
|
||||
_storage[11] = _container.Resolve(typeof(IFoo11<IFoo11>), null);
|
||||
_storage[12] = _container.Resolve(typeof(IFoo12<IFoo12>), null);
|
||||
_storage[13] = _container.Resolve(typeof(IFoo13<IFoo13>), null);
|
||||
_storage[14] = _container.Resolve(typeof(IFoo14<IFoo14>), null);
|
||||
_storage[15] = _container.Resolve(typeof(IFoo15<IFoo15>), null);
|
||||
_storage[16] = _container.Resolve(typeof(IFoo16<IFoo16>), null);
|
||||
_storage[17] = _container.Resolve(typeof(IFoo17<IFoo17>), null);
|
||||
_storage[18] = _container.Resolve(typeof(IFoo18<IFoo18>), null);
|
||||
_storage[19] = _container.Resolve(typeof(IFoo19<IFoo19>), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object Factory()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[01] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[02] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[03] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[04] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[05] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[06] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[07] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[08] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[09] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[10] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[11] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[12] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[13] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[14] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[15] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[16] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[17] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[18] = _container.Resolve(typeof(IFoo), null);
|
||||
_storage[19] = _container.Resolve(typeof(IFoo), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object Instance()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IFoo<Foo00>), null);
|
||||
_storage[01] = _container.Resolve(typeof(IFoo<Foo01>), null);
|
||||
_storage[02] = _container.Resolve(typeof(IFoo<Foo02>), null);
|
||||
_storage[03] = _container.Resolve(typeof(IFoo<Foo03>), null);
|
||||
_storage[04] = _container.Resolve(typeof(IFoo<Foo04>), null);
|
||||
_storage[05] = _container.Resolve(typeof(IFoo<Foo05>), null);
|
||||
_storage[06] = _container.Resolve(typeof(IFoo<Foo06>), null);
|
||||
_storage[07] = _container.Resolve(typeof(IFoo<Foo07>), null);
|
||||
_storage[08] = _container.Resolve(typeof(IFoo<Foo08>), null);
|
||||
_storage[09] = _container.Resolve(typeof(IFoo<Foo09>), null);
|
||||
_storage[10] = _container.Resolve(typeof(IFoo<Foo10>), null);
|
||||
_storage[11] = _container.Resolve(typeof(IFoo<Foo11>), null);
|
||||
_storage[12] = _container.Resolve(typeof(IFoo<Foo12>), null);
|
||||
_storage[13] = _container.Resolve(typeof(IFoo<Foo13>), null);
|
||||
_storage[14] = _container.Resolve(typeof(IFoo<Foo14>), null);
|
||||
_storage[15] = _container.Resolve(typeof(IFoo<Foo15>), null);
|
||||
_storage[16] = _container.Resolve(typeof(IFoo<Foo16>), null);
|
||||
_storage[17] = _container.Resolve(typeof(IFoo<Foo17>), null);
|
||||
_storage[18] = _container.Resolve(typeof(IFoo<Foo18>), null);
|
||||
_storage[19] = _container.Resolve(typeof(IFoo<Foo19>), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object LegacyFactory()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IFoo00), "2");
|
||||
_storage[01] = _container.Resolve(typeof(IFoo01), "2");
|
||||
_storage[02] = _container.Resolve(typeof(IFoo02), "2");
|
||||
_storage[03] = _container.Resolve(typeof(IFoo03), "2");
|
||||
_storage[04] = _container.Resolve(typeof(IFoo04), "2");
|
||||
_storage[05] = _container.Resolve(typeof(IFoo05), "2");
|
||||
_storage[06] = _container.Resolve(typeof(IFoo06), "2");
|
||||
_storage[07] = _container.Resolve(typeof(IFoo07), "2");
|
||||
_storage[08] = _container.Resolve(typeof(IFoo08), "2");
|
||||
_storage[09] = _container.Resolve(typeof(IFoo09), "2");
|
||||
_storage[10] = _container.Resolve(typeof(IFoo10), "2");
|
||||
_storage[11] = _container.Resolve(typeof(IFoo11), "2");
|
||||
_storage[12] = _container.Resolve(typeof(IFoo12), "2");
|
||||
_storage[13] = _container.Resolve(typeof(IFoo13), "2");
|
||||
_storage[14] = _container.Resolve(typeof(IFoo14), "2");
|
||||
_storage[15] = _container.Resolve(typeof(IFoo15), "2");
|
||||
_storage[16] = _container.Resolve(typeof(IFoo16), "2");
|
||||
_storage[17] = _container.Resolve(typeof(IFoo17), "2");
|
||||
_storage[18] = _container.Resolve(typeof(IFoo18), "2");
|
||||
_storage[19] = _container.Resolve(typeof(IFoo19), "2");
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object Array()
|
||||
{
|
||||
_storage[00] = _container.Resolve(typeof(IFoo00[]), null);
|
||||
_storage[01] = _container.Resolve(typeof(IFoo01[]), null);
|
||||
_storage[02] = _container.Resolve(typeof(IFoo02[]), null);
|
||||
_storage[03] = _container.Resolve(typeof(IFoo03[]), null);
|
||||
_storage[04] = _container.Resolve(typeof(IFoo04[]), null);
|
||||
_storage[05] = _container.Resolve(typeof(IFoo05[]), null);
|
||||
_storage[06] = _container.Resolve(typeof(IFoo06[]), null);
|
||||
_storage[07] = _container.Resolve(typeof(IFoo07[]), null);
|
||||
_storage[08] = _container.Resolve(typeof(IFoo08[]), null);
|
||||
_storage[09] = _container.Resolve(typeof(IFoo09[]), null);
|
||||
_storage[10] = _container.Resolve(typeof(IFoo10[]), null);
|
||||
_storage[11] = _container.Resolve(typeof(IFoo11[]), null);
|
||||
_storage[12] = _container.Resolve(typeof(IFoo12[]), null);
|
||||
_storage[13] = _container.Resolve(typeof(IFoo13[]), null);
|
||||
_storage[14] = _container.Resolve(typeof(IFoo14[]), null);
|
||||
_storage[15] = _container.Resolve(typeof(IFoo15[]), null);
|
||||
_storage[16] = _container.Resolve(typeof(IFoo16[]), null);
|
||||
_storage[17] = _container.Resolve(typeof(IFoo17[]), null);
|
||||
_storage[18] = _container.Resolve(typeof(IFoo18[]), null);
|
||||
_storage[19] = _container.Resolve(typeof(IFoo19[]), null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object Enumerable()
|
||||
{
|
||||
_storage[00] = (_container.Resolve(typeof(IEnumerable<IFoo00>), null) as IEnumerable<IFoo00>)?.Count();
|
||||
_storage[01] = (_container.Resolve(typeof(IEnumerable<IFoo01>), null) as IEnumerable<IFoo01>)?.Count();
|
||||
_storage[02] = (_container.Resolve(typeof(IEnumerable<IFoo02>), null) as IEnumerable<IFoo02>)?.Count();
|
||||
_storage[03] = (_container.Resolve(typeof(IEnumerable<IFoo03>), null) as IEnumerable<IFoo03>)?.Count();
|
||||
_storage[04] = (_container.Resolve(typeof(IEnumerable<IFoo04>), null) as IEnumerable<IFoo04>)?.Count();
|
||||
_storage[05] = (_container.Resolve(typeof(IEnumerable<IFoo05>), null) as IEnumerable<IFoo05>)?.Count();
|
||||
_storage[06] = (_container.Resolve(typeof(IEnumerable<IFoo06>), null) as IEnumerable<IFoo06>)?.Count();
|
||||
_storage[07] = (_container.Resolve(typeof(IEnumerable<IFoo07>), null) as IEnumerable<IFoo07>)?.Count();
|
||||
_storage[08] = (_container.Resolve(typeof(IEnumerable<IFoo08>), null) as IEnumerable<IFoo08>)?.Count();
|
||||
_storage[09] = (_container.Resolve(typeof(IEnumerable<IFoo09>), null) as IEnumerable<IFoo09>)?.Count();
|
||||
_storage[10] = (_container.Resolve(typeof(IEnumerable<IFoo10>), null) as IEnumerable<IFoo10>)?.Count();
|
||||
_storage[11] = (_container.Resolve(typeof(IEnumerable<IFoo11>), null) as IEnumerable<IFoo11>)?.Count();
|
||||
_storage[12] = (_container.Resolve(typeof(IEnumerable<IFoo12>), null) as IEnumerable<IFoo12>)?.Count();
|
||||
_storage[13] = (_container.Resolve(typeof(IEnumerable<IFoo13>), null) as IEnumerable<IFoo13>)?.Count();
|
||||
_storage[14] = (_container.Resolve(typeof(IEnumerable<IFoo14>), null) as IEnumerable<IFoo14>)?.Count();
|
||||
_storage[15] = (_container.Resolve(typeof(IEnumerable<IFoo15>), null) as IEnumerable<IFoo15>)?.Count();
|
||||
_storage[16] = (_container.Resolve(typeof(IEnumerable<IFoo16>), null) as IEnumerable<IFoo16>)?.Count();
|
||||
_storage[17] = (_container.Resolve(typeof(IEnumerable<IFoo17>), null) as IEnumerable<IFoo17>)?.Count();
|
||||
_storage[18] = (_container.Resolve(typeof(IEnumerable<IFoo18>), null) as IEnumerable<IFoo18>)?.Count();
|
||||
_storage[19] = (_container.Resolve(typeof(IEnumerable<IFoo19>), null) as IEnumerable<IFoo19>)?.Count();
|
||||
|
||||
return _storage;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,807 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Runner.Setup;
|
||||
using System.Linq;
|
||||
using Unity;
|
||||
|
||||
namespace Performance.Tests
|
||||
{
|
||||
[BenchmarkCategory("Registration")]
|
||||
[Config(typeof(BenchmarkConfiguration))]
|
||||
public class RegistrationBase
|
||||
{
|
||||
IUnityContainer _container = new UnityContainer();
|
||||
|
||||
readonly Foo00 instance00 = new Foo00();
|
||||
readonly Foo01 instance01 = new Foo01();
|
||||
readonly Foo02 instance02 = new Foo02();
|
||||
readonly Foo03 instance03 = new Foo03();
|
||||
readonly Foo04 instance04 = new Foo04();
|
||||
readonly Foo05 instance05 = new Foo05();
|
||||
readonly Foo06 instance06 = new Foo06();
|
||||
readonly Foo07 instance07 = new Foo07();
|
||||
readonly Foo08 instance08 = new Foo08();
|
||||
readonly Foo09 instance09 = new Foo09();
|
||||
readonly Foo10 instance10 = new Foo10();
|
||||
readonly Foo11 instance11 = new Foo11();
|
||||
readonly Foo12 instance12 = new Foo12();
|
||||
readonly Foo13 instance13 = new Foo13();
|
||||
readonly Foo14 instance14 = new Foo14();
|
||||
readonly Foo15 instance15 = new Foo15();
|
||||
readonly Foo16 instance16 = new Foo16();
|
||||
readonly Foo17 instance17 = new Foo17();
|
||||
readonly Foo18 instance18 = new Foo18();
|
||||
readonly Foo19 instance19 = new Foo19();
|
||||
protected object[] _storage = new object[20];
|
||||
|
||||
|
||||
[IterationSetup]
|
||||
public virtual void SetupContainer()
|
||||
{
|
||||
_container.RegisterType<PocoWithDependency00>();
|
||||
_container.RegisterType<PocoWithDependency01>();
|
||||
_container.RegisterType<PocoWithDependency02>();
|
||||
_container.RegisterType<PocoWithDependency03>();
|
||||
_container.RegisterType<PocoWithDependency04>();
|
||||
_container.RegisterType<PocoWithDependency05>();
|
||||
_container.RegisterType<PocoWithDependency06>();
|
||||
_container.RegisterType<PocoWithDependency07>();
|
||||
_container.RegisterType<PocoWithDependency08>();
|
||||
_container.RegisterType<PocoWithDependency09>();
|
||||
_container.RegisterType<PocoWithDependency10>();
|
||||
_container.RegisterType<PocoWithDependency11>();
|
||||
_container.RegisterType<PocoWithDependency12>();
|
||||
_container.RegisterType<PocoWithDependency13>();
|
||||
_container.RegisterType<PocoWithDependency14>();
|
||||
_container.RegisterType<PocoWithDependency15>();
|
||||
_container.RegisterType<PocoWithDependency16>();
|
||||
_container.RegisterType<PocoWithDependency17>();
|
||||
_container.RegisterType<PocoWithDependency18>();
|
||||
_container.RegisterType<PocoWithDependency19>();
|
||||
|
||||
_container.RegisterType<IFoo00, Foo00>();
|
||||
_container.RegisterType<IFoo01, Foo01>();
|
||||
_container.RegisterType<IFoo02, Foo02>();
|
||||
_container.RegisterType<IFoo03, Foo03>();
|
||||
_container.RegisterType<IFoo04, Foo04>();
|
||||
_container.RegisterType<IFoo05, Foo05>();
|
||||
_container.RegisterType<IFoo06, Foo06>();
|
||||
_container.RegisterType<IFoo07, Foo07>();
|
||||
_container.RegisterType<IFoo08, Foo08>();
|
||||
_container.RegisterType<IFoo09, Foo09>();
|
||||
_container.RegisterType<IFoo10, Foo10>();
|
||||
_container.RegisterType<IFoo11, Foo11>();
|
||||
_container.RegisterType<IFoo12, Foo12>();
|
||||
_container.RegisterType<IFoo13, Foo13>();
|
||||
_container.RegisterType<IFoo14, Foo14>();
|
||||
_container.RegisterType<IFoo15, Foo15>();
|
||||
_container.RegisterType<IFoo16, Foo16>();
|
||||
_container.RegisterType<IFoo17, Foo17>();
|
||||
_container.RegisterType<IFoo18, Foo18>();
|
||||
_container.RegisterType<IFoo19, Foo19>();
|
||||
|
||||
_container.RegisterType<IFoo00, Foo00>("1");
|
||||
_container.RegisterType<IFoo01, Foo01>("1");
|
||||
_container.RegisterType<IFoo02, Foo02>("1");
|
||||
_container.RegisterType<IFoo03, Foo03>("1");
|
||||
_container.RegisterType<IFoo04, Foo04>("1");
|
||||
_container.RegisterType<IFoo05, Foo05>("1");
|
||||
_container.RegisterType<IFoo06, Foo06>("1");
|
||||
_container.RegisterType<IFoo07, Foo07>("1");
|
||||
_container.RegisterType<IFoo08, Foo08>("1");
|
||||
_container.RegisterType<IFoo09, Foo09>("1");
|
||||
_container.RegisterType<IFoo10, Foo10>("1");
|
||||
_container.RegisterType<IFoo11, Foo11>("1");
|
||||
_container.RegisterType<IFoo12, Foo12>("1");
|
||||
_container.RegisterType<IFoo13, Foo13>("1");
|
||||
_container.RegisterType<IFoo14, Foo14>("1");
|
||||
_container.RegisterType<IFoo15, Foo15>("1");
|
||||
_container.RegisterType<IFoo16, Foo16>("1");
|
||||
_container.RegisterType<IFoo17, Foo17>("1");
|
||||
_container.RegisterType<IFoo18, Foo18>("1");
|
||||
_container.RegisterType<IFoo19, Foo19>("1");
|
||||
|
||||
_container.RegisterFactory<IFoo00>("2", c => new Foo00());
|
||||
_container.RegisterFactory<IFoo01>("2", c => new Foo01());
|
||||
_container.RegisterFactory<IFoo02>("2", c => new Foo02());
|
||||
_container.RegisterFactory<IFoo03>("2", c => new Foo03());
|
||||
_container.RegisterFactory<IFoo04>("2", c => new Foo04());
|
||||
_container.RegisterFactory<IFoo05>("2", c => new Foo05());
|
||||
_container.RegisterFactory<IFoo06>("2", c => new Foo06());
|
||||
_container.RegisterFactory<IFoo07>("2", c => new Foo07());
|
||||
_container.RegisterFactory<IFoo08>("2", c => new Foo08());
|
||||
_container.RegisterFactory<IFoo09>("2", c => new Foo09());
|
||||
_container.RegisterFactory<IFoo10>("2", c => new Foo10());
|
||||
_container.RegisterFactory<IFoo11>("2", c => new Foo11());
|
||||
_container.RegisterFactory<IFoo12>("2", c => new Foo12());
|
||||
_container.RegisterFactory<IFoo13>("2", c => new Foo13());
|
||||
_container.RegisterFactory<IFoo14>("2", c => new Foo14());
|
||||
_container.RegisterFactory<IFoo15>("2", c => new Foo15());
|
||||
_container.RegisterFactory<IFoo16>("2", c => new Foo16());
|
||||
_container.RegisterFactory<IFoo17>("2", c => new Foo17());
|
||||
_container.RegisterFactory<IFoo18>("2", c => new Foo18());
|
||||
_container.RegisterFactory<IFoo19>("2", c => new Foo19());
|
||||
|
||||
_container.RegisterInstance(typeof(IFoo<Foo00>), new Foo<Foo00>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo01>), new Foo<Foo01>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo02>), new Foo<Foo02>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo03>), new Foo<Foo03>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo04>), new Foo<Foo04>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo05>), new Foo<Foo05>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo06>), new Foo<Foo06>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo07>), new Foo<Foo07>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo08>), new Foo<Foo08>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo09>), new Foo<Foo09>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo10>), new Foo<Foo10>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo11>), new Foo<Foo11>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo12>), new Foo<Foo12>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo13>), new Foo<Foo13>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo14>), new Foo<Foo14>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo15>), new Foo<Foo15>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo16>), new Foo<Foo16>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo17>), new Foo<Foo17>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo18>), new Foo<Foo18>());
|
||||
_container.RegisterInstance(typeof(IFoo<Foo19>), new Foo<Foo19>());
|
||||
}
|
||||
|
||||
|
||||
public virtual object Register()
|
||||
{
|
||||
_storage[00] = _container.RegisterType(null, typeof(Foo00), null, null);
|
||||
_storage[01] = _container.RegisterType(null, typeof(Foo01), null, null);
|
||||
_storage[02] = _container.RegisterType(null, typeof(Foo02), null, null);
|
||||
_storage[03] = _container.RegisterType(null, typeof(Foo03), null, null);
|
||||
_storage[04] = _container.RegisterType(null, typeof(Foo04), null, null);
|
||||
_storage[05] = _container.RegisterType(null, typeof(Foo05), null, null);
|
||||
_storage[06] = _container.RegisterType(null, typeof(Foo06), null, null);
|
||||
_storage[07] = _container.RegisterType(null, typeof(Foo07), null, null);
|
||||
_storage[08] = _container.RegisterType(null, typeof(Foo08), null, null);
|
||||
_storage[09] = _container.RegisterType(null, typeof(Foo09), null, null);
|
||||
_storage[10] = _container.RegisterType(null, typeof(Foo10), null, null);
|
||||
_storage[11] = _container.RegisterType(null, typeof(Foo11), null, null);
|
||||
_storage[12] = _container.RegisterType(null, typeof(Foo12), null, null);
|
||||
_storage[13] = _container.RegisterType(null, typeof(Foo13), null, null);
|
||||
_storage[14] = _container.RegisterType(null, typeof(Foo14), null, null);
|
||||
_storage[15] = _container.RegisterType(null, typeof(Foo15), null, null);
|
||||
_storage[16] = _container.RegisterType(null, typeof(Foo16), null, null);
|
||||
_storage[17] = _container.RegisterType(null, typeof(Foo17), null, null);
|
||||
_storage[18] = _container.RegisterType(null, typeof(Foo18), null, null);
|
||||
_storage[19] = _container.RegisterType(null, typeof(Foo19), null, null);
|
||||
|
||||
_storage[00] = _container.RegisterType(null, typeof(Foo00), "1", null);
|
||||
_storage[01] = _container.RegisterType(null, typeof(Foo01), "1", null);
|
||||
_storage[02] = _container.RegisterType(null, typeof(Foo02), "1", null);
|
||||
_storage[03] = _container.RegisterType(null, typeof(Foo03), "1", null);
|
||||
_storage[04] = _container.RegisterType(null, typeof(Foo04), "1", null);
|
||||
_storage[05] = _container.RegisterType(null, typeof(Foo05), "1", null);
|
||||
_storage[06] = _container.RegisterType(null, typeof(Foo06), "1", null);
|
||||
_storage[07] = _container.RegisterType(null, typeof(Foo07), "1", null);
|
||||
_storage[08] = _container.RegisterType(null, typeof(Foo08), "1", null);
|
||||
_storage[09] = _container.RegisterType(null, typeof(Foo09), "1", null);
|
||||
_storage[10] = _container.RegisterType(null, typeof(Foo10), "1", null);
|
||||
_storage[11] = _container.RegisterType(null, typeof(Foo11), "1", null);
|
||||
_storage[12] = _container.RegisterType(null, typeof(Foo12), "1", null);
|
||||
_storage[13] = _container.RegisterType(null, typeof(Foo13), "1", null);
|
||||
_storage[14] = _container.RegisterType(null, typeof(Foo14), "1", null);
|
||||
_storage[15] = _container.RegisterType(null, typeof(Foo15), "1", null);
|
||||
_storage[16] = _container.RegisterType(null, typeof(Foo16), "1", null);
|
||||
_storage[17] = _container.RegisterType(null, typeof(Foo17), "1", null);
|
||||
_storage[18] = _container.RegisterType(null, typeof(Foo18), "1", null);
|
||||
_storage[19] = _container.RegisterType(null, typeof(Foo19), "1", null);
|
||||
|
||||
_storage[00] = _container.RegisterType(null, typeof(Foo00), "2", null);
|
||||
_storage[01] = _container.RegisterType(null, typeof(Foo01), "2", null);
|
||||
_storage[02] = _container.RegisterType(null, typeof(Foo02), "2", null);
|
||||
_storage[03] = _container.RegisterType(null, typeof(Foo03), "2", null);
|
||||
_storage[04] = _container.RegisterType(null, typeof(Foo04), "2", null);
|
||||
_storage[05] = _container.RegisterType(null, typeof(Foo05), "2", null);
|
||||
_storage[06] = _container.RegisterType(null, typeof(Foo06), "2", null);
|
||||
_storage[07] = _container.RegisterType(null, typeof(Foo07), "2", null);
|
||||
_storage[08] = _container.RegisterType(null, typeof(Foo08), "2", null);
|
||||
_storage[09] = _container.RegisterType(null, typeof(Foo09), "2", null);
|
||||
_storage[10] = _container.RegisterType(null, typeof(Foo10), "2", null);
|
||||
_storage[11] = _container.RegisterType(null, typeof(Foo11), "2", null);
|
||||
_storage[12] = _container.RegisterType(null, typeof(Foo12), "2", null);
|
||||
_storage[13] = _container.RegisterType(null, typeof(Foo13), "2", null);
|
||||
_storage[14] = _container.RegisterType(null, typeof(Foo14), "2", null);
|
||||
_storage[15] = _container.RegisterType(null, typeof(Foo15), "2", null);
|
||||
_storage[16] = _container.RegisterType(null, typeof(Foo16), "2", null);
|
||||
_storage[17] = _container.RegisterType(null, typeof(Foo17), "2", null);
|
||||
_storage[18] = _container.RegisterType(null, typeof(Foo18), "2", null);
|
||||
_storage[19] = _container.RegisterType(null, typeof(Foo19), "2", null);
|
||||
|
||||
_storage[00] = _container.RegisterType(null, typeof(Foo00), "3", null);
|
||||
_storage[01] = _container.RegisterType(null, typeof(Foo01), "3", null);
|
||||
_storage[02] = _container.RegisterType(null, typeof(Foo02), "3", null);
|
||||
_storage[03] = _container.RegisterType(null, typeof(Foo03), "3", null);
|
||||
_storage[04] = _container.RegisterType(null, typeof(Foo04), "3", null);
|
||||
_storage[05] = _container.RegisterType(null, typeof(Foo05), "3", null);
|
||||
_storage[06] = _container.RegisterType(null, typeof(Foo06), "3", null);
|
||||
_storage[07] = _container.RegisterType(null, typeof(Foo07), "3", null);
|
||||
_storage[08] = _container.RegisterType(null, typeof(Foo08), "3", null);
|
||||
_storage[09] = _container.RegisterType(null, typeof(Foo09), "3", null);
|
||||
_storage[10] = _container.RegisterType(null, typeof(Foo10), "3", null);
|
||||
_storage[11] = _container.RegisterType(null, typeof(Foo11), "3", null);
|
||||
_storage[12] = _container.RegisterType(null, typeof(Foo12), "3", null);
|
||||
_storage[13] = _container.RegisterType(null, typeof(Foo13), "3", null);
|
||||
_storage[14] = _container.RegisterType(null, typeof(Foo14), "3", null);
|
||||
_storage[15] = _container.RegisterType(null, typeof(Foo15), "3", null);
|
||||
_storage[16] = _container.RegisterType(null, typeof(Foo16), "3", null);
|
||||
_storage[17] = _container.RegisterType(null, typeof(Foo17), "3", null);
|
||||
_storage[18] = _container.RegisterType(null, typeof(Foo18), "3", null);
|
||||
_storage[19] = _container.RegisterType(null, typeof(Foo19), "3", null);
|
||||
|
||||
_storage[00] = _container.RegisterType(null, typeof(Foo00), "4", null);
|
||||
_storage[01] = _container.RegisterType(null, typeof(Foo01), "4", null);
|
||||
_storage[02] = _container.RegisterType(null, typeof(Foo02), "4", null);
|
||||
_storage[03] = _container.RegisterType(null, typeof(Foo03), "4", null);
|
||||
_storage[04] = _container.RegisterType(null, typeof(Foo04), "4", null);
|
||||
_storage[05] = _container.RegisterType(null, typeof(Foo05), "4", null);
|
||||
_storage[06] = _container.RegisterType(null, typeof(Foo06), "4", null);
|
||||
_storage[07] = _container.RegisterType(null, typeof(Foo07), "4", null);
|
||||
_storage[08] = _container.RegisterType(null, typeof(Foo08), "4", null);
|
||||
_storage[09] = _container.RegisterType(null, typeof(Foo09), "4", null);
|
||||
_storage[10] = _container.RegisterType(null, typeof(Foo10), "4", null);
|
||||
_storage[11] = _container.RegisterType(null, typeof(Foo11), "4", null);
|
||||
_storage[12] = _container.RegisterType(null, typeof(Foo12), "4", null);
|
||||
_storage[13] = _container.RegisterType(null, typeof(Foo13), "4", null);
|
||||
_storage[14] = _container.RegisterType(null, typeof(Foo14), "4", null);
|
||||
_storage[15] = _container.RegisterType(null, typeof(Foo15), "4", null);
|
||||
_storage[16] = _container.RegisterType(null, typeof(Foo16), "4", null);
|
||||
_storage[17] = _container.RegisterType(null, typeof(Foo17), "4", null);
|
||||
_storage[18] = _container.RegisterType(null, typeof(Foo18), "4", null);
|
||||
_storage[19] = _container.RegisterType(null, typeof(Foo19), "4", null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object RegisterMapping()
|
||||
{
|
||||
_storage[00] = _container.RegisterType(typeof(IFoo00), typeof(Foo00), null, null);
|
||||
_storage[01] = _container.RegisterType(typeof(IFoo01), typeof(Foo01), null, null);
|
||||
_storage[02] = _container.RegisterType(typeof(IFoo02), typeof(Foo02), null, null);
|
||||
_storage[03] = _container.RegisterType(typeof(IFoo03), typeof(Foo03), null, null);
|
||||
_storage[04] = _container.RegisterType(typeof(IFoo04), typeof(Foo04), null, null);
|
||||
_storage[05] = _container.RegisterType(typeof(IFoo05), typeof(Foo05), null, null);
|
||||
_storage[06] = _container.RegisterType(typeof(IFoo06), typeof(Foo06), null, null);
|
||||
_storage[07] = _container.RegisterType(typeof(IFoo07), typeof(Foo07), null, null);
|
||||
_storage[08] = _container.RegisterType(typeof(IFoo08), typeof(Foo08), null, null);
|
||||
_storage[09] = _container.RegisterType(typeof(IFoo09), typeof(Foo09), null, null);
|
||||
_storage[10] = _container.RegisterType(typeof(IFoo10), typeof(Foo10), null, null);
|
||||
_storage[11] = _container.RegisterType(typeof(IFoo11), typeof(Foo11), null, null);
|
||||
_storage[12] = _container.RegisterType(typeof(IFoo12), typeof(Foo12), null, null);
|
||||
_storage[13] = _container.RegisterType(typeof(IFoo13), typeof(Foo13), null, null);
|
||||
_storage[14] = _container.RegisterType(typeof(IFoo14), typeof(Foo14), null, null);
|
||||
_storage[15] = _container.RegisterType(typeof(IFoo15), typeof(Foo15), null, null);
|
||||
_storage[16] = _container.RegisterType(typeof(IFoo16), typeof(Foo16), null, null);
|
||||
_storage[17] = _container.RegisterType(typeof(IFoo17), typeof(Foo17), null, null);
|
||||
_storage[18] = _container.RegisterType(typeof(IFoo18), typeof(Foo18), null, null);
|
||||
_storage[19] = _container.RegisterType(typeof(IFoo19), typeof(Foo19), null, null);
|
||||
|
||||
_storage[00] = _container.RegisterType(typeof(IFoo00), typeof(Foo00), "1", null);
|
||||
_storage[01] = _container.RegisterType(typeof(IFoo01), typeof(Foo01), "1", null);
|
||||
_storage[02] = _container.RegisterType(typeof(IFoo02), typeof(Foo02), "1", null);
|
||||
_storage[03] = _container.RegisterType(typeof(IFoo03), typeof(Foo03), "1", null);
|
||||
_storage[04] = _container.RegisterType(typeof(IFoo04), typeof(Foo04), "1", null);
|
||||
_storage[05] = _container.RegisterType(typeof(IFoo05), typeof(Foo05), "1", null);
|
||||
_storage[06] = _container.RegisterType(typeof(IFoo06), typeof(Foo06), "1", null);
|
||||
_storage[07] = _container.RegisterType(typeof(IFoo07), typeof(Foo07), "1", null);
|
||||
_storage[08] = _container.RegisterType(typeof(IFoo08), typeof(Foo08), "1", null);
|
||||
_storage[09] = _container.RegisterType(typeof(IFoo09), typeof(Foo09), "1", null);
|
||||
_storage[10] = _container.RegisterType(typeof(IFoo10), typeof(Foo10), "1", null);
|
||||
_storage[11] = _container.RegisterType(typeof(IFoo11), typeof(Foo11), "1", null);
|
||||
_storage[12] = _container.RegisterType(typeof(IFoo12), typeof(Foo12), "1", null);
|
||||
_storage[13] = _container.RegisterType(typeof(IFoo13), typeof(Foo13), "1", null);
|
||||
_storage[14] = _container.RegisterType(typeof(IFoo14), typeof(Foo14), "1", null);
|
||||
_storage[15] = _container.RegisterType(typeof(IFoo15), typeof(Foo15), "1", null);
|
||||
_storage[16] = _container.RegisterType(typeof(IFoo16), typeof(Foo16), "1", null);
|
||||
_storage[17] = _container.RegisterType(typeof(IFoo17), typeof(Foo17), "1", null);
|
||||
_storage[18] = _container.RegisterType(typeof(IFoo18), typeof(Foo18), "1", null);
|
||||
_storage[19] = _container.RegisterType(typeof(IFoo19), typeof(Foo19), "1", null);
|
||||
|
||||
_storage[00] = _container.RegisterType(typeof(IFoo00), typeof(Foo00), "2", null);
|
||||
_storage[01] = _container.RegisterType(typeof(IFoo01), typeof(Foo01), "2", null);
|
||||
_storage[02] = _container.RegisterType(typeof(IFoo02), typeof(Foo02), "2", null);
|
||||
_storage[03] = _container.RegisterType(typeof(IFoo03), typeof(Foo03), "2", null);
|
||||
_storage[04] = _container.RegisterType(typeof(IFoo04), typeof(Foo04), "2", null);
|
||||
_storage[05] = _container.RegisterType(typeof(IFoo05), typeof(Foo05), "2", null);
|
||||
_storage[06] = _container.RegisterType(typeof(IFoo06), typeof(Foo06), "2", null);
|
||||
_storage[07] = _container.RegisterType(typeof(IFoo07), typeof(Foo07), "2", null);
|
||||
_storage[08] = _container.RegisterType(typeof(IFoo08), typeof(Foo08), "2", null);
|
||||
_storage[09] = _container.RegisterType(typeof(IFoo09), typeof(Foo09), "2", null);
|
||||
_storage[10] = _container.RegisterType(typeof(IFoo10), typeof(Foo10), "2", null);
|
||||
_storage[11] = _container.RegisterType(typeof(IFoo11), typeof(Foo11), "2", null);
|
||||
_storage[12] = _container.RegisterType(typeof(IFoo12), typeof(Foo12), "2", null);
|
||||
_storage[13] = _container.RegisterType(typeof(IFoo13), typeof(Foo13), "2", null);
|
||||
_storage[14] = _container.RegisterType(typeof(IFoo14), typeof(Foo14), "2", null);
|
||||
_storage[15] = _container.RegisterType(typeof(IFoo15), typeof(Foo15), "2", null);
|
||||
_storage[16] = _container.RegisterType(typeof(IFoo16), typeof(Foo16), "2", null);
|
||||
_storage[17] = _container.RegisterType(typeof(IFoo17), typeof(Foo17), "2", null);
|
||||
_storage[18] = _container.RegisterType(typeof(IFoo18), typeof(Foo18), "2", null);
|
||||
_storage[19] = _container.RegisterType(typeof(IFoo19), typeof(Foo19), "2", null);
|
||||
|
||||
_storage[00] = _container.RegisterType(typeof(IFoo00), typeof(Foo00), "3", null);
|
||||
_storage[01] = _container.RegisterType(typeof(IFoo01), typeof(Foo01), "3", null);
|
||||
_storage[02] = _container.RegisterType(typeof(IFoo02), typeof(Foo02), "3", null);
|
||||
_storage[03] = _container.RegisterType(typeof(IFoo03), typeof(Foo03), "3", null);
|
||||
_storage[04] = _container.RegisterType(typeof(IFoo04), typeof(Foo04), "3", null);
|
||||
_storage[05] = _container.RegisterType(typeof(IFoo05), typeof(Foo05), "3", null);
|
||||
_storage[06] = _container.RegisterType(typeof(IFoo06), typeof(Foo06), "3", null);
|
||||
_storage[07] = _container.RegisterType(typeof(IFoo07), typeof(Foo07), "3", null);
|
||||
_storage[08] = _container.RegisterType(typeof(IFoo08), typeof(Foo08), "3", null);
|
||||
_storage[09] = _container.RegisterType(typeof(IFoo09), typeof(Foo09), "3", null);
|
||||
_storage[10] = _container.RegisterType(typeof(IFoo10), typeof(Foo10), "3", null);
|
||||
_storage[11] = _container.RegisterType(typeof(IFoo11), typeof(Foo11), "3", null);
|
||||
_storage[12] = _container.RegisterType(typeof(IFoo12), typeof(Foo12), "3", null);
|
||||
_storage[13] = _container.RegisterType(typeof(IFoo13), typeof(Foo13), "3", null);
|
||||
_storage[14] = _container.RegisterType(typeof(IFoo14), typeof(Foo14), "3", null);
|
||||
_storage[15] = _container.RegisterType(typeof(IFoo15), typeof(Foo15), "3", null);
|
||||
_storage[16] = _container.RegisterType(typeof(IFoo16), typeof(Foo16), "3", null);
|
||||
_storage[17] = _container.RegisterType(typeof(IFoo17), typeof(Foo17), "3", null);
|
||||
_storage[18] = _container.RegisterType(typeof(IFoo18), typeof(Foo18), "3", null);
|
||||
_storage[19] = _container.RegisterType(typeof(IFoo19), typeof(Foo19), "3", null);
|
||||
|
||||
_storage[00] = _container.RegisterType(typeof(IFoo00), typeof(Foo00), "4", null);
|
||||
_storage[01] = _container.RegisterType(typeof(IFoo01), typeof(Foo01), "4", null);
|
||||
_storage[02] = _container.RegisterType(typeof(IFoo02), typeof(Foo02), "4", null);
|
||||
_storage[03] = _container.RegisterType(typeof(IFoo03), typeof(Foo03), "4", null);
|
||||
_storage[04] = _container.RegisterType(typeof(IFoo04), typeof(Foo04), "4", null);
|
||||
_storage[05] = _container.RegisterType(typeof(IFoo05), typeof(Foo05), "4", null);
|
||||
_storage[06] = _container.RegisterType(typeof(IFoo06), typeof(Foo06), "4", null);
|
||||
_storage[07] = _container.RegisterType(typeof(IFoo07), typeof(Foo07), "4", null);
|
||||
_storage[08] = _container.RegisterType(typeof(IFoo08), typeof(Foo08), "4", null);
|
||||
_storage[09] = _container.RegisterType(typeof(IFoo09), typeof(Foo09), "4", null);
|
||||
_storage[10] = _container.RegisterType(typeof(IFoo10), typeof(Foo10), "4", null);
|
||||
_storage[11] = _container.RegisterType(typeof(IFoo11), typeof(Foo11), "4", null);
|
||||
_storage[12] = _container.RegisterType(typeof(IFoo12), typeof(Foo12), "4", null);
|
||||
_storage[13] = _container.RegisterType(typeof(IFoo13), typeof(Foo13), "4", null);
|
||||
_storage[14] = _container.RegisterType(typeof(IFoo14), typeof(Foo14), "4", null);
|
||||
_storage[15] = _container.RegisterType(typeof(IFoo15), typeof(Foo15), "4", null);
|
||||
_storage[16] = _container.RegisterType(typeof(IFoo16), typeof(Foo16), "4", null);
|
||||
_storage[17] = _container.RegisterType(typeof(IFoo17), typeof(Foo17), "4", null);
|
||||
_storage[18] = _container.RegisterType(typeof(IFoo18), typeof(Foo18), "4", null);
|
||||
_storage[19] = _container.RegisterType(typeof(IFoo19), typeof(Foo19), "4", null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object RegisterInstance()
|
||||
{
|
||||
_storage[00] = _container.RegisterInstance(null, null, instance00, null);
|
||||
_storage[01] = _container.RegisterInstance(null, null, instance01, null);
|
||||
_storage[02] = _container.RegisterInstance(null, null, instance02, null);
|
||||
_storage[03] = _container.RegisterInstance(null, null, instance03, null);
|
||||
_storage[04] = _container.RegisterInstance(null, null, instance04, null);
|
||||
_storage[05] = _container.RegisterInstance(null, null, instance05, null);
|
||||
_storage[06] = _container.RegisterInstance(null, null, instance06, null);
|
||||
_storage[07] = _container.RegisterInstance(null, null, instance07, null);
|
||||
_storage[08] = _container.RegisterInstance(null, null, instance08, null);
|
||||
_storage[09] = _container.RegisterInstance(null, null, instance09, null);
|
||||
_storage[10] = _container.RegisterInstance(null, null, instance10, null);
|
||||
_storage[11] = _container.RegisterInstance(null, null, instance11, null);
|
||||
_storage[12] = _container.RegisterInstance(null, null, instance12, null);
|
||||
_storage[13] = _container.RegisterInstance(null, null, instance13, null);
|
||||
_storage[14] = _container.RegisterInstance(null, null, instance14, null);
|
||||
_storage[15] = _container.RegisterInstance(null, null, instance15, null);
|
||||
_storage[16] = _container.RegisterInstance(null, null, instance16, null);
|
||||
_storage[17] = _container.RegisterInstance(null, null, instance17, null);
|
||||
_storage[18] = _container.RegisterInstance(null, null, instance18, null);
|
||||
_storage[19] = _container.RegisterInstance(null, null, instance19, null);
|
||||
|
||||
_storage[00] = _container.RegisterInstance(null, "1", instance00, null);
|
||||
_storage[01] = _container.RegisterInstance(null, "1", instance01, null);
|
||||
_storage[02] = _container.RegisterInstance(null, "1", instance02, null);
|
||||
_storage[03] = _container.RegisterInstance(null, "1", instance03, null);
|
||||
_storage[04] = _container.RegisterInstance(null, "1", instance04, null);
|
||||
_storage[05] = _container.RegisterInstance(null, "1", instance05, null);
|
||||
_storage[06] = _container.RegisterInstance(null, "1", instance06, null);
|
||||
_storage[07] = _container.RegisterInstance(null, "1", instance07, null);
|
||||
_storage[08] = _container.RegisterInstance(null, "1", instance08, null);
|
||||
_storage[09] = _container.RegisterInstance(null, "1", instance09, null);
|
||||
_storage[10] = _container.RegisterInstance(null, "1", instance10, null);
|
||||
_storage[11] = _container.RegisterInstance(null, "1", instance11, null);
|
||||
_storage[12] = _container.RegisterInstance(null, "1", instance12, null);
|
||||
_storage[13] = _container.RegisterInstance(null, "1", instance13, null);
|
||||
_storage[14] = _container.RegisterInstance(null, "1", instance14, null);
|
||||
_storage[15] = _container.RegisterInstance(null, "1", instance15, null);
|
||||
_storage[16] = _container.RegisterInstance(null, "1", instance16, null);
|
||||
_storage[17] = _container.RegisterInstance(null, "1", instance17, null);
|
||||
_storage[18] = _container.RegisterInstance(null, "1", instance18, null);
|
||||
_storage[19] = _container.RegisterInstance(null, "1", instance19, null);
|
||||
|
||||
_storage[00] = _container.RegisterInstance(null, "2", instance00, null);
|
||||
_storage[01] = _container.RegisterInstance(null, "2", instance01, null);
|
||||
_storage[02] = _container.RegisterInstance(null, "2", instance02, null);
|
||||
_storage[03] = _container.RegisterInstance(null, "2", instance03, null);
|
||||
_storage[04] = _container.RegisterInstance(null, "2", instance04, null);
|
||||
_storage[05] = _container.RegisterInstance(null, "2", instance05, null);
|
||||
_storage[06] = _container.RegisterInstance(null, "2", instance06, null);
|
||||
_storage[07] = _container.RegisterInstance(null, "2", instance07, null);
|
||||
_storage[08] = _container.RegisterInstance(null, "2", instance08, null);
|
||||
_storage[09] = _container.RegisterInstance(null, "2", instance09, null);
|
||||
_storage[10] = _container.RegisterInstance(null, "2", instance10, null);
|
||||
_storage[11] = _container.RegisterInstance(null, "2", instance11, null);
|
||||
_storage[12] = _container.RegisterInstance(null, "2", instance12, null);
|
||||
_storage[13] = _container.RegisterInstance(null, "2", instance13, null);
|
||||
_storage[14] = _container.RegisterInstance(null, "2", instance14, null);
|
||||
_storage[15] = _container.RegisterInstance(null, "2", instance15, null);
|
||||
_storage[16] = _container.RegisterInstance(null, "2", instance16, null);
|
||||
_storage[17] = _container.RegisterInstance(null, "2", instance17, null);
|
||||
_storage[18] = _container.RegisterInstance(null, "2", instance18, null);
|
||||
_storage[19] = _container.RegisterInstance(null, "2", instance19, null);
|
||||
|
||||
_storage[00] = _container.RegisterInstance(null, "3", instance00, null);
|
||||
_storage[01] = _container.RegisterInstance(null, "3", instance01, null);
|
||||
_storage[02] = _container.RegisterInstance(null, "3", instance02, null);
|
||||
_storage[03] = _container.RegisterInstance(null, "3", instance03, null);
|
||||
_storage[04] = _container.RegisterInstance(null, "3", instance04, null);
|
||||
_storage[05] = _container.RegisterInstance(null, "3", instance05, null);
|
||||
_storage[06] = _container.RegisterInstance(null, "3", instance06, null);
|
||||
_storage[07] = _container.RegisterInstance(null, "3", instance07, null);
|
||||
_storage[08] = _container.RegisterInstance(null, "3", instance08, null);
|
||||
_storage[09] = _container.RegisterInstance(null, "3", instance09, null);
|
||||
_storage[10] = _container.RegisterInstance(null, "3", instance10, null);
|
||||
_storage[11] = _container.RegisterInstance(null, "3", instance11, null);
|
||||
_storage[12] = _container.RegisterInstance(null, "3", instance12, null);
|
||||
_storage[13] = _container.RegisterInstance(null, "3", instance13, null);
|
||||
_storage[14] = _container.RegisterInstance(null, "3", instance14, null);
|
||||
_storage[15] = _container.RegisterInstance(null, "3", instance15, null);
|
||||
_storage[16] = _container.RegisterInstance(null, "3", instance16, null);
|
||||
_storage[17] = _container.RegisterInstance(null, "3", instance17, null);
|
||||
_storage[18] = _container.RegisterInstance(null, "3", instance18, null);
|
||||
_storage[19] = _container.RegisterInstance(null, "3", instance19, null);
|
||||
|
||||
_storage[00] = _container.RegisterInstance(null, "4", instance00, null);
|
||||
_storage[01] = _container.RegisterInstance(null, "4", instance01, null);
|
||||
_storage[02] = _container.RegisterInstance(null, "4", instance02, null);
|
||||
_storage[03] = _container.RegisterInstance(null, "4", instance03, null);
|
||||
_storage[04] = _container.RegisterInstance(null, "4", instance04, null);
|
||||
_storage[05] = _container.RegisterInstance(null, "4", instance05, null);
|
||||
_storage[06] = _container.RegisterInstance(null, "4", instance06, null);
|
||||
_storage[07] = _container.RegisterInstance(null, "4", instance07, null);
|
||||
_storage[08] = _container.RegisterInstance(null, "4", instance08, null);
|
||||
_storage[09] = _container.RegisterInstance(null, "4", instance09, null);
|
||||
_storage[10] = _container.RegisterInstance(null, "4", instance10, null);
|
||||
_storage[11] = _container.RegisterInstance(null, "4", instance11, null);
|
||||
_storage[12] = _container.RegisterInstance(null, "4", instance12, null);
|
||||
_storage[13] = _container.RegisterInstance(null, "4", instance13, null);
|
||||
_storage[14] = _container.RegisterInstance(null, "4", instance14, null);
|
||||
_storage[15] = _container.RegisterInstance(null, "4", instance15, null);
|
||||
_storage[16] = _container.RegisterInstance(null, "4", instance16, null);
|
||||
_storage[17] = _container.RegisterInstance(null, "4", instance17, null);
|
||||
_storage[18] = _container.RegisterInstance(null, "4", instance18, null);
|
||||
_storage[19] = _container.RegisterInstance(null, "4", instance19, null);
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object Registrations()
|
||||
{
|
||||
_storage[00] = _container.Registrations.ToArray();
|
||||
_storage[01] = _container.Registrations.ToArray();
|
||||
_storage[02] = _container.Registrations.ToArray();
|
||||
_storage[03] = _container.Registrations.ToArray();
|
||||
_storage[04] = _container.Registrations.ToArray();
|
||||
_storage[05] = _container.Registrations.ToArray();
|
||||
_storage[06] = _container.Registrations.ToArray();
|
||||
_storage[07] = _container.Registrations.ToArray();
|
||||
_storage[08] = _container.Registrations.ToArray();
|
||||
_storage[09] = _container.Registrations.ToArray();
|
||||
_storage[10] = _container.Registrations.ToArray();
|
||||
_storage[11] = _container.Registrations.ToArray();
|
||||
_storage[12] = _container.Registrations.ToArray();
|
||||
_storage[13] = _container.Registrations.ToArray();
|
||||
_storage[14] = _container.Registrations.ToArray();
|
||||
_storage[15] = _container.Registrations.ToArray();
|
||||
_storage[16] = _container.Registrations.ToArray();
|
||||
_storage[17] = _container.Registrations.ToArray();
|
||||
_storage[18] = _container.Registrations.ToArray();
|
||||
_storage[19] = _container.Registrations.ToArray();
|
||||
|
||||
_storage[00] = _container.Registrations.ToArray();
|
||||
_storage[01] = _container.Registrations.ToArray();
|
||||
_storage[02] = _container.Registrations.ToArray();
|
||||
_storage[03] = _container.Registrations.ToArray();
|
||||
_storage[04] = _container.Registrations.ToArray();
|
||||
_storage[05] = _container.Registrations.ToArray();
|
||||
_storage[06] = _container.Registrations.ToArray();
|
||||
_storage[07] = _container.Registrations.ToArray();
|
||||
_storage[08] = _container.Registrations.ToArray();
|
||||
_storage[09] = _container.Registrations.ToArray();
|
||||
_storage[10] = _container.Registrations.ToArray();
|
||||
_storage[11] = _container.Registrations.ToArray();
|
||||
_storage[12] = _container.Registrations.ToArray();
|
||||
_storage[13] = _container.Registrations.ToArray();
|
||||
_storage[14] = _container.Registrations.ToArray();
|
||||
_storage[15] = _container.Registrations.ToArray();
|
||||
_storage[16] = _container.Registrations.ToArray();
|
||||
_storage[17] = _container.Registrations.ToArray();
|
||||
_storage[18] = _container.Registrations.ToArray();
|
||||
_storage[19] = _container.Registrations.ToArray();
|
||||
|
||||
_storage[00] = _container.Registrations.ToArray();
|
||||
_storage[01] = _container.Registrations.ToArray();
|
||||
_storage[02] = _container.Registrations.ToArray();
|
||||
_storage[03] = _container.Registrations.ToArray();
|
||||
_storage[04] = _container.Registrations.ToArray();
|
||||
_storage[05] = _container.Registrations.ToArray();
|
||||
_storage[06] = _container.Registrations.ToArray();
|
||||
_storage[07] = _container.Registrations.ToArray();
|
||||
_storage[08] = _container.Registrations.ToArray();
|
||||
_storage[09] = _container.Registrations.ToArray();
|
||||
_storage[10] = _container.Registrations.ToArray();
|
||||
_storage[11] = _container.Registrations.ToArray();
|
||||
_storage[12] = _container.Registrations.ToArray();
|
||||
_storage[13] = _container.Registrations.ToArray();
|
||||
_storage[14] = _container.Registrations.ToArray();
|
||||
_storage[15] = _container.Registrations.ToArray();
|
||||
_storage[16] = _container.Registrations.ToArray();
|
||||
_storage[17] = _container.Registrations.ToArray();
|
||||
_storage[18] = _container.Registrations.ToArray();
|
||||
_storage[19] = _container.Registrations.ToArray();
|
||||
|
||||
_storage[00] = _container.Registrations.ToArray();
|
||||
_storage[01] = _container.Registrations.ToArray();
|
||||
_storage[02] = _container.Registrations.ToArray();
|
||||
_storage[03] = _container.Registrations.ToArray();
|
||||
_storage[04] = _container.Registrations.ToArray();
|
||||
_storage[05] = _container.Registrations.ToArray();
|
||||
_storage[06] = _container.Registrations.ToArray();
|
||||
_storage[07] = _container.Registrations.ToArray();
|
||||
_storage[08] = _container.Registrations.ToArray();
|
||||
_storage[09] = _container.Registrations.ToArray();
|
||||
_storage[10] = _container.Registrations.ToArray();
|
||||
_storage[11] = _container.Registrations.ToArray();
|
||||
_storage[12] = _container.Registrations.ToArray();
|
||||
_storage[13] = _container.Registrations.ToArray();
|
||||
_storage[14] = _container.Registrations.ToArray();
|
||||
_storage[15] = _container.Registrations.ToArray();
|
||||
_storage[16] = _container.Registrations.ToArray();
|
||||
_storage[17] = _container.Registrations.ToArray();
|
||||
_storage[18] = _container.Registrations.ToArray();
|
||||
_storage[19] = _container.Registrations.ToArray();
|
||||
|
||||
_storage[00] = _container.Registrations.ToArray();
|
||||
_storage[01] = _container.Registrations.ToArray();
|
||||
_storage[02] = _container.Registrations.ToArray();
|
||||
_storage[03] = _container.Registrations.ToArray();
|
||||
_storage[04] = _container.Registrations.ToArray();
|
||||
_storage[05] = _container.Registrations.ToArray();
|
||||
_storage[06] = _container.Registrations.ToArray();
|
||||
_storage[07] = _container.Registrations.ToArray();
|
||||
_storage[08] = _container.Registrations.ToArray();
|
||||
_storage[09] = _container.Registrations.ToArray();
|
||||
_storage[10] = _container.Registrations.ToArray();
|
||||
_storage[11] = _container.Registrations.ToArray();
|
||||
_storage[12] = _container.Registrations.ToArray();
|
||||
_storage[13] = _container.Registrations.ToArray();
|
||||
_storage[14] = _container.Registrations.ToArray();
|
||||
_storage[15] = _container.Registrations.ToArray();
|
||||
_storage[16] = _container.Registrations.ToArray();
|
||||
_storage[17] = _container.Registrations.ToArray();
|
||||
_storage[18] = _container.Registrations.ToArray();
|
||||
_storage[19] = _container.Registrations.ToArray();
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object IsRegistered()
|
||||
{
|
||||
_storage[00] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[01] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[02] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[03] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[04] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[05] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[06] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[07] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[08] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[09] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[10] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[11] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[12] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[13] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[14] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[15] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[16] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[17] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[18] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[19] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
|
||||
_storage[00] = _container.IsRegistered(typeof(PocoWithDependency00));
|
||||
_storage[01] = _container.IsRegistered(typeof(PocoWithDependency01));
|
||||
_storage[02] = _container.IsRegistered(typeof(PocoWithDependency02));
|
||||
_storage[03] = _container.IsRegistered(typeof(PocoWithDependency03));
|
||||
_storage[04] = _container.IsRegistered(typeof(PocoWithDependency04));
|
||||
_storage[05] = _container.IsRegistered(typeof(PocoWithDependency05));
|
||||
_storage[06] = _container.IsRegistered(typeof(PocoWithDependency06));
|
||||
_storage[07] = _container.IsRegistered(typeof(PocoWithDependency07));
|
||||
_storage[08] = _container.IsRegistered(typeof(PocoWithDependency08));
|
||||
_storage[09] = _container.IsRegistered(typeof(PocoWithDependency09));
|
||||
_storage[10] = _container.IsRegistered(typeof(PocoWithDependency10));
|
||||
_storage[11] = _container.IsRegistered(typeof(PocoWithDependency11));
|
||||
_storage[12] = _container.IsRegistered(typeof(PocoWithDependency12));
|
||||
_storage[13] = _container.IsRegistered(typeof(PocoWithDependency13));
|
||||
_storage[14] = _container.IsRegistered(typeof(PocoWithDependency14));
|
||||
_storage[15] = _container.IsRegistered(typeof(PocoWithDependency15));
|
||||
_storage[16] = _container.IsRegistered(typeof(PocoWithDependency16));
|
||||
_storage[17] = _container.IsRegistered(typeof(PocoWithDependency17));
|
||||
_storage[18] = _container.IsRegistered(typeof(PocoWithDependency18));
|
||||
_storage[19] = _container.IsRegistered(typeof(PocoWithDependency19));
|
||||
|
||||
_storage[00] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[01] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[02] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[03] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[04] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[05] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[06] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[07] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[08] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[09] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[10] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[11] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[12] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[13] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[14] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[15] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[16] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[17] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[18] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[19] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
|
||||
_storage[00] = _container.IsRegistered(typeof(PocoWithDependency00));
|
||||
_storage[01] = _container.IsRegistered(typeof(PocoWithDependency01));
|
||||
_storage[02] = _container.IsRegistered(typeof(PocoWithDependency02));
|
||||
_storage[03] = _container.IsRegistered(typeof(PocoWithDependency03));
|
||||
_storage[04] = _container.IsRegistered(typeof(PocoWithDependency04));
|
||||
_storage[05] = _container.IsRegistered(typeof(PocoWithDependency05));
|
||||
_storage[06] = _container.IsRegistered(typeof(PocoWithDependency06));
|
||||
_storage[07] = _container.IsRegistered(typeof(PocoWithDependency07));
|
||||
_storage[08] = _container.IsRegistered(typeof(PocoWithDependency08));
|
||||
_storage[09] = _container.IsRegistered(typeof(PocoWithDependency09));
|
||||
_storage[10] = _container.IsRegistered(typeof(PocoWithDependency10));
|
||||
_storage[11] = _container.IsRegistered(typeof(PocoWithDependency11));
|
||||
_storage[12] = _container.IsRegistered(typeof(PocoWithDependency12));
|
||||
_storage[13] = _container.IsRegistered(typeof(PocoWithDependency13));
|
||||
_storage[14] = _container.IsRegistered(typeof(PocoWithDependency14));
|
||||
_storage[15] = _container.IsRegistered(typeof(PocoWithDependency15));
|
||||
_storage[16] = _container.IsRegistered(typeof(PocoWithDependency16));
|
||||
_storage[17] = _container.IsRegistered(typeof(PocoWithDependency17));
|
||||
_storage[18] = _container.IsRegistered(typeof(PocoWithDependency18));
|
||||
_storage[19] = _container.IsRegistered(typeof(PocoWithDependency19));
|
||||
|
||||
_storage[00] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[01] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[02] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[03] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[04] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[05] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[06] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[07] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[08] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[09] = _container.IsRegistered(typeof(IUnityContainer));
|
||||
_storage[10] = _container.IsRegistered(typeof(PocoWithDependency10));
|
||||
_storage[11] = _container.IsRegistered(typeof(PocoWithDependency11));
|
||||
_storage[12] = _container.IsRegistered(typeof(PocoWithDependency12));
|
||||
_storage[13] = _container.IsRegistered(typeof(PocoWithDependency13));
|
||||
_storage[14] = _container.IsRegistered(typeof(PocoWithDependency14));
|
||||
_storage[15] = _container.IsRegistered(typeof(PocoWithDependency15));
|
||||
_storage[16] = _container.IsRegistered(typeof(PocoWithDependency16));
|
||||
_storage[17] = _container.IsRegistered(typeof(PocoWithDependency17));
|
||||
_storage[18] = _container.IsRegistered(typeof(PocoWithDependency18));
|
||||
_storage[19] = _container.IsRegistered(typeof(PocoWithDependency19));
|
||||
|
||||
return _storage;
|
||||
}
|
||||
|
||||
public virtual object IsRegisteredFalse()
|
||||
{
|
||||
_storage[00] = _container.IsRegistered(typeof(PocoWithDependency00), "00");
|
||||
_storage[01] = _container.IsRegistered(typeof(PocoWithDependency01), "01");
|
||||
_storage[02] = _container.IsRegistered(typeof(PocoWithDependency02), "02");
|
||||
_storage[03] = _container.IsRegistered(typeof(PocoWithDependency03), "03");
|
||||
_storage[04] = _container.IsRegistered(typeof(PocoWithDependency04), "04");
|
||||
_storage[05] = _container.IsRegistered(typeof(PocoWithDependency05), "05");
|
||||
_storage[06] = _container.IsRegistered(typeof(PocoWithDependency06), "06");
|
||||
_storage[07] = _container.IsRegistered(typeof(PocoWithDependency07), "07");
|
||||
_storage[08] = _container.IsRegistered(typeof(PocoWithDependency08), "08");
|
||||
_storage[09] = _container.IsRegistered(typeof(PocoWithDependency09), "09");
|
||||
_storage[10] = _container.IsRegistered(typeof(PocoWithDependency10), "10");
|
||||
_storage[11] = _container.IsRegistered(typeof(PocoWithDependency11), "11");
|
||||
_storage[12] = _container.IsRegistered(typeof(PocoWithDependency12), "12");
|
||||
_storage[13] = _container.IsRegistered(typeof(PocoWithDependency13), "13");
|
||||
_storage[14] = _container.IsRegistered(typeof(PocoWithDependency14), "14");
|
||||
_storage[15] = _container.IsRegistered(typeof(PocoWithDependency15), "15");
|
||||
_storage[16] = _container.IsRegistered(typeof(PocoWithDependency16), "16");
|
||||
_storage[17] = _container.IsRegistered(typeof(PocoWithDependency17), "17");
|
||||
_storage[18] = _container.IsRegistered(typeof(PocoWithDependency18), "18");
|
||||
_storage[19] = _container.IsRegistered(typeof(PocoWithDependency19), "19");
|
||||
|
||||
_storage[00] = _container.IsRegistered(typeof(IFoo), "00");
|
||||
_storage[01] = _container.IsRegistered(typeof(IFoo), "01");
|
||||
_storage[02] = _container.IsRegistered(typeof(IFoo), "02");
|
||||
_storage[03] = _container.IsRegistered(typeof(IFoo), "03");
|
||||
_storage[04] = _container.IsRegistered(typeof(IFoo), "04");
|
||||
_storage[05] = _container.IsRegistered(typeof(IFoo), "05");
|
||||
_storage[06] = _container.IsRegistered(typeof(IFoo), "06");
|
||||
_storage[07] = _container.IsRegistered(typeof(IFoo), "07");
|
||||
_storage[08] = _container.IsRegistered(typeof(IFoo), "08");
|
||||
_storage[09] = _container.IsRegistered(typeof(IFoo), "09");
|
||||
_storage[10] = _container.IsRegistered(typeof(IFoo), "10");
|
||||
_storage[11] = _container.IsRegistered(typeof(IFoo), "11");
|
||||
_storage[12] = _container.IsRegistered(typeof(IFoo), "12");
|
||||
_storage[13] = _container.IsRegistered(typeof(IFoo), "13");
|
||||
_storage[14] = _container.IsRegistered(typeof(IFoo), "14");
|
||||
_storage[15] = _container.IsRegistered(typeof(IFoo), "15");
|
||||
_storage[16] = _container.IsRegistered(typeof(IFoo), "16");
|
||||
_storage[17] = _container.IsRegistered(typeof(IFoo), "17");
|
||||
_storage[18] = _container.IsRegistered(typeof(IFoo), "18");
|
||||
_storage[19] = _container.IsRegistered(typeof(IFoo), "19");
|
||||
|
||||
_storage[00] = _container.IsRegistered(typeof(PocoWithDependency00), "00");
|
||||
_storage[01] = _container.IsRegistered(typeof(PocoWithDependency01), "01");
|
||||
_storage[02] = _container.IsRegistered(typeof(PocoWithDependency02), "02");
|
||||
_storage[03] = _container.IsRegistered(typeof(PocoWithDependency03), "03");
|
||||
_storage[04] = _container.IsRegistered(typeof(PocoWithDependency04), "04");
|
||||
_storage[05] = _container.IsRegistered(typeof(PocoWithDependency05), "05");
|
||||
_storage[06] = _container.IsRegistered(typeof(PocoWithDependency06), "06");
|
||||
_storage[07] = _container.IsRegistered(typeof(PocoWithDependency07), "07");
|
||||
_storage[08] = _container.IsRegistered(typeof(PocoWithDependency08), "08");
|
||||
_storage[09] = _container.IsRegistered(typeof(PocoWithDependency09), "09");
|
||||
_storage[10] = _container.IsRegistered(typeof(PocoWithDependency10), "10");
|
||||
_storage[11] = _container.IsRegistered(typeof(PocoWithDependency11), "11");
|
||||
_storage[12] = _container.IsRegistered(typeof(PocoWithDependency12), "12");
|
||||
_storage[13] = _container.IsRegistered(typeof(PocoWithDependency13), "13");
|
||||
_storage[14] = _container.IsRegistered(typeof(PocoWithDependency14), "14");
|
||||
_storage[15] = _container.IsRegistered(typeof(PocoWithDependency15), "15");
|
||||
_storage[16] = _container.IsRegistered(typeof(PocoWithDependency16), "16");
|
||||
_storage[17] = _container.IsRegistered(typeof(PocoWithDependency17), "17");
|
||||
_storage[18] = _container.IsRegistered(typeof(PocoWithDependency18), "18");
|
||||
_storage[19] = _container.IsRegistered(typeof(PocoWithDependency19), "19");
|
||||
|
||||
_storage[00] = _container.IsRegistered(typeof(IFoo), "00");
|
||||
_storage[01] = _container.IsRegistered(typeof(IFoo), "01");
|
||||
_storage[02] = _container.IsRegistered(typeof(IFoo), "02");
|
||||
_storage[03] = _container.IsRegistered(typeof(IFoo), "03");
|
||||
_storage[04] = _container.IsRegistered(typeof(IFoo), "04");
|
||||
_storage[05] = _container.IsRegistered(typeof(IFoo), "05");
|
||||
_storage[06] = _container.IsRegistered(typeof(IFoo), "06");
|
||||
_storage[07] = _container.IsRegistered(typeof(IFoo), "07");
|
||||
_storage[08] = _container.IsRegistered(typeof(IFoo), "08");
|
||||
_storage[09] = _container.IsRegistered(typeof(IFoo), "09");
|
||||
_storage[10] = _container.IsRegistered(typeof(IFoo), "10");
|
||||
_storage[11] = _container.IsRegistered(typeof(IFoo), "11");
|
||||
_storage[12] = _container.IsRegistered(typeof(IFoo), "12");
|
||||
_storage[13] = _container.IsRegistered(typeof(IFoo), "13");
|
||||
_storage[14] = _container.IsRegistered(typeof(IFoo), "14");
|
||||
_storage[15] = _container.IsRegistered(typeof(IFoo), "15");
|
||||
_storage[16] = _container.IsRegistered(typeof(IFoo), "16");
|
||||
_storage[17] = _container.IsRegistered(typeof(IFoo), "17");
|
||||
_storage[18] = _container.IsRegistered(typeof(IFoo), "18");
|
||||
_storage[19] = _container.IsRegistered(typeof(IFoo), "19");
|
||||
|
||||
_storage[00] = _container.IsRegistered(typeof(PocoWithDependency00), "00");
|
||||
_storage[01] = _container.IsRegistered(typeof(PocoWithDependency01), "01");
|
||||
_storage[02] = _container.IsRegistered(typeof(PocoWithDependency02), "02");
|
||||
_storage[03] = _container.IsRegistered(typeof(PocoWithDependency03), "03");
|
||||
_storage[04] = _container.IsRegistered(typeof(PocoWithDependency04), "04");
|
||||
_storage[05] = _container.IsRegistered(typeof(PocoWithDependency05), "05");
|
||||
_storage[06] = _container.IsRegistered(typeof(PocoWithDependency06), "06");
|
||||
_storage[07] = _container.IsRegistered(typeof(PocoWithDependency07), "07");
|
||||
_storage[08] = _container.IsRegistered(typeof(PocoWithDependency08), "08");
|
||||
_storage[09] = _container.IsRegistered(typeof(PocoWithDependency09), "09");
|
||||
_storage[10] = _container.IsRegistered(typeof(IFoo), "10");
|
||||
_storage[11] = _container.IsRegistered(typeof(IFoo), "11");
|
||||
_storage[12] = _container.IsRegistered(typeof(IFoo), "12");
|
||||
_storage[13] = _container.IsRegistered(typeof(IFoo), "13");
|
||||
_storage[14] = _container.IsRegistered(typeof(IFoo), "14");
|
||||
_storage[15] = _container.IsRegistered(typeof(IFoo), "15");
|
||||
_storage[16] = _container.IsRegistered(typeof(IFoo), "16");
|
||||
_storage[17] = _container.IsRegistered(typeof(IFoo), "17");
|
||||
_storage[18] = _container.IsRegistered(typeof(IFoo), "18");
|
||||
_storage[19] = _container.IsRegistered(typeof(IFoo), "19");
|
||||
|
||||
return _storage;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
using Unity;
|
||||
|
||||
namespace Performance.Tests
|
||||
{
|
||||
#region Plain Old CLR object
|
||||
|
||||
public class Poco00 { }
|
||||
public class Poco01 { }
|
||||
public class Poco02 { }
|
||||
public class Poco03 { }
|
||||
public class Poco04 { }
|
||||
public class Poco05 { }
|
||||
public class Poco06 { }
|
||||
public class Poco07 { }
|
||||
public class Poco08 { }
|
||||
public class Poco09 { }
|
||||
public class Poco10 { }
|
||||
public class Poco11 { }
|
||||
public class Poco12 { }
|
||||
public class Poco13 { }
|
||||
public class Poco14 { }
|
||||
public class Poco15 { }
|
||||
public class Poco16 { }
|
||||
public class Poco17 { }
|
||||
public class Poco18 { }
|
||||
public class Poco19 { }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region PocoWithDependency
|
||||
|
||||
public class PocoWithDependency
|
||||
{
|
||||
[Dependency]
|
||||
public object Dependency { get; set; }
|
||||
|
||||
[InjectionMethod]
|
||||
public object CallMe([Dependency]object data) => data;
|
||||
}
|
||||
|
||||
public class PocoWithDependency00 : PocoWithDependency { }
|
||||
public class PocoWithDependency01 : PocoWithDependency { }
|
||||
public class PocoWithDependency02 : PocoWithDependency { }
|
||||
public class PocoWithDependency03 : PocoWithDependency { }
|
||||
public class PocoWithDependency04 : PocoWithDependency { }
|
||||
public class PocoWithDependency05 : PocoWithDependency { }
|
||||
public class PocoWithDependency06 : PocoWithDependency { }
|
||||
public class PocoWithDependency07 : PocoWithDependency { }
|
||||
public class PocoWithDependency08 : PocoWithDependency { }
|
||||
public class PocoWithDependency09 : PocoWithDependency { }
|
||||
public class PocoWithDependency10 : PocoWithDependency { }
|
||||
public class PocoWithDependency11 : PocoWithDependency { }
|
||||
public class PocoWithDependency12 : PocoWithDependency { }
|
||||
public class PocoWithDependency13 : PocoWithDependency { }
|
||||
public class PocoWithDependency14 : PocoWithDependency { }
|
||||
public class PocoWithDependency15 : PocoWithDependency { }
|
||||
public class PocoWithDependency16 : PocoWithDependency { }
|
||||
public class PocoWithDependency17 : PocoWithDependency { }
|
||||
public class PocoWithDependency18 : PocoWithDependency { }
|
||||
public class PocoWithDependency19 : PocoWithDependency { }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IFoo
|
||||
|
||||
public interface IFoo { }
|
||||
public interface IFoo00 { }
|
||||
public interface IFoo01 { }
|
||||
public interface IFoo02 { }
|
||||
public interface IFoo03 { }
|
||||
public interface IFoo04 { }
|
||||
public interface IFoo05 { }
|
||||
public interface IFoo06 { }
|
||||
public interface IFoo07 { }
|
||||
public interface IFoo08 { }
|
||||
public interface IFoo09 { }
|
||||
public interface IFoo10 { }
|
||||
public interface IFoo11 { }
|
||||
public interface IFoo12 { }
|
||||
public interface IFoo13 { }
|
||||
public interface IFoo14 { }
|
||||
public interface IFoo15 { }
|
||||
public interface IFoo16 { }
|
||||
public interface IFoo17 { }
|
||||
public interface IFoo18 { }
|
||||
public interface IFoo19 { }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Foo
|
||||
|
||||
public class Foo : IFoo { }
|
||||
public class Foo00 : IFoo00 { }
|
||||
public class Foo01 : IFoo01 { }
|
||||
public class Foo02 : IFoo02 { }
|
||||
public class Foo03 : IFoo03 { }
|
||||
public class Foo04 : IFoo04 { }
|
||||
public class Foo05 : IFoo05 { }
|
||||
public class Foo06 : IFoo06 { }
|
||||
public class Foo07 : IFoo07 { }
|
||||
public class Foo08 : IFoo08 { }
|
||||
public class Foo09 : IFoo09 { }
|
||||
public class Foo10 : IFoo10 { }
|
||||
public class Foo11 : IFoo11 { }
|
||||
public class Foo12 : IFoo12 { }
|
||||
public class Foo13 : IFoo13 { }
|
||||
public class Foo14 : IFoo14 { }
|
||||
public class Foo15 : IFoo15 { }
|
||||
public class Foo16 : IFoo16 { }
|
||||
public class Foo17 : IFoo17 { }
|
||||
public class Foo18 : IFoo18 { }
|
||||
public class Foo19 : IFoo19 { }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IFoo<>
|
||||
|
||||
public interface IFoo<T> { }
|
||||
public interface IFoo00<T> { }
|
||||
public interface IFoo01<T> { }
|
||||
public interface IFoo02<T> { }
|
||||
public interface IFoo03<T> { }
|
||||
public interface IFoo04<T> { }
|
||||
public interface IFoo05<T> { }
|
||||
public interface IFoo06<T> { }
|
||||
public interface IFoo07<T> { }
|
||||
public interface IFoo08<T> { }
|
||||
public interface IFoo09<T> { }
|
||||
public interface IFoo10<T> { }
|
||||
public interface IFoo11<T> { }
|
||||
public interface IFoo12<T> { }
|
||||
public interface IFoo13<T> { }
|
||||
public interface IFoo14<T> { }
|
||||
public interface IFoo15<T> { }
|
||||
public interface IFoo16<T> { }
|
||||
public interface IFoo17<T> { }
|
||||
public interface IFoo18<T> { }
|
||||
public interface IFoo19<T> { }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IFoo<>
|
||||
|
||||
public class Foo<T> : IFoo<T> { }
|
||||
public class Foo00<T> : IFoo00<T> { }
|
||||
public class Foo01<T> : IFoo01<T> { }
|
||||
public class Foo02<T> : IFoo02<T> { }
|
||||
public class Foo03<T> : IFoo03<T> { }
|
||||
public class Foo04<T> : IFoo04<T> { }
|
||||
public class Foo05<T> : IFoo05<T> { }
|
||||
public class Foo06<T> : IFoo06<T> { }
|
||||
public class Foo07<T> : IFoo07<T> { }
|
||||
public class Foo08<T> : IFoo08<T> { }
|
||||
public class Foo09<T> : IFoo09<T> { }
|
||||
public class Foo10<T> : IFoo10<T> { }
|
||||
public class Foo11<T> : IFoo11<T> { }
|
||||
public class Foo12<T> : IFoo12<T> { }
|
||||
public class Foo13<T> : IFoo13<T> { }
|
||||
public class Foo14<T> : IFoo14<T> { }
|
||||
public class Foo15<T> : IFoo15<T> { }
|
||||
public class Foo16<T> : IFoo16<T> { }
|
||||
public class Foo17<T> : IFoo17<T> { }
|
||||
public class Foo18<T> : IFoo18<T> { }
|
||||
public class Foo19<T> : IFoo19<T> { }
|
||||
|
||||
#endregion
|
||||
}
|
|
@ -17,6 +17,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Abstractions\src\Unity.Abstractions.csproj" />
|
||||
<ProjectReference Include="..\..\src\Unity.Container.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Runner.Setup;
|
||||
using System.Collections.Generic;
|
||||
using Unity;
|
||||
|
||||
namespace Runner.Tests
|
||||
{
|
||||
[BenchmarkCategory("Basic")]
|
||||
[Config(typeof(BenchmarkConfiguration))]
|
||||
public class Compiled
|
||||
{
|
||||
IUnityContainer _container;
|
||||
object _syncRoot = new object();
|
||||
|
||||
[IterationSetup]
|
||||
public virtual void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer().AddExtension(new ForceCompillation());
|
||||
|
||||
_container.RegisterType<Poco>();
|
||||
_container.RegisterType<IFoo, Foo>();
|
||||
_container.RegisterType<IFoo, Foo>("1");
|
||||
_container.RegisterFactory<IFoo>("2", c => new Foo());
|
||||
}
|
||||
|
||||
[Benchmark(Description = "Resolve<IUnityContainer> ")]
|
||||
public object UnityContainer() => _container.Resolve(typeof(IUnityContainer), null);
|
||||
|
||||
[Benchmark(Description = "Compiled<object> (unregistered)")]
|
||||
public object Unregistered() => _container.Resolve(typeof(object), null);
|
||||
|
||||
[Benchmark(Description = "Compiled<Poco> (registered)")]
|
||||
public object Transient() => _container.Resolve(typeof(Poco), null);
|
||||
|
||||
[Benchmark(Description = "Compiled<IService> (registered)")]
|
||||
public object Mapping() => _container.Resolve(typeof(IFoo), null);
|
||||
|
||||
[Benchmark(Description = "Compiled<IService> (legacy)")]
|
||||
public object LegacyFactory() => _container.Resolve(typeof(IFoo), "2");
|
||||
|
||||
[Benchmark(Description = "Compiled<IService[]> (registered)")]
|
||||
public object Array() => _container.Resolve(typeof(IFoo[]), null);
|
||||
|
||||
[Benchmark(Description = "Compiled<IEnumerable<IService>> (registered)")]
|
||||
public object Enumerable() => _container.Resolve(typeof(IEnumerable<IFoo>), null);
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Runner.Setup;
|
||||
using System.Collections.Generic;
|
||||
using Unity;
|
||||
using Unity.Builder;
|
||||
|
||||
namespace Runner.Tests
|
||||
{
|
||||
[BenchmarkCategory("Basic")]
|
||||
[Config(typeof(BenchmarkConfiguration))]
|
||||
public class PreCompiled
|
||||
{
|
||||
IUnityContainer _container;
|
||||
object _syncRoot = new object();
|
||||
|
||||
[IterationSetup]
|
||||
public virtual void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer().AddExtension(new ForceCompillation());
|
||||
|
||||
_container.RegisterType<Poco>();
|
||||
_container.RegisterType<IFoo, Foo>();
|
||||
_container.RegisterType<IFoo, Foo>("1");
|
||||
_container.RegisterFactory<IFoo>("2", c => new Foo());
|
||||
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
_container.Resolve<object>();
|
||||
_container.Resolve<Poco>();
|
||||
_container.Resolve<IFoo>();
|
||||
_container.Resolve<IFoo>("1");
|
||||
_container.Resolve<IFoo>("2");
|
||||
}
|
||||
}
|
||||
|
||||
[Benchmark(Description = "Resolve<IUnityContainer> ")]
|
||||
public object UnityContainer() => _container.Resolve(typeof(IUnityContainer), null);
|
||||
|
||||
[Benchmark(Description = "PreCompiled<object> (pre-built)")]
|
||||
public object Unregistered() => _container.Resolve(typeof(object), null);
|
||||
|
||||
[Benchmark(Description = "PreCompiled<Poco> (pre-built)")]
|
||||
public object Transient() => _container.Resolve(typeof(Poco), null);
|
||||
|
||||
[Benchmark(Description = "PreCompiled<IService> (pre-built)")]
|
||||
public object Mapping() => _container.Resolve(typeof(IFoo), null);
|
||||
|
||||
[Benchmark(Description = "Compiled<IService> (legacy)")]
|
||||
public object LegacyFactory() => _container.Resolve(typeof(IFoo), "2");
|
||||
|
||||
[Benchmark(Description = "PreCompiled<IService[]> (pre-built)")]
|
||||
public object Array() => _container.Resolve(typeof(IFoo[]), null);
|
||||
|
||||
[Benchmark(Description = "PreCompiled<IEnumerable<IService>> (pre-built)")]
|
||||
public object Enumerable() => _container.Resolve(typeof(IEnumerable<IFoo>), null);
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Runner.Setup;
|
||||
using System.Collections.Generic;
|
||||
using Unity;
|
||||
using Unity.Builder;
|
||||
|
||||
namespace Runner.Tests
|
||||
{
|
||||
[BenchmarkCategory("Basic")]
|
||||
[Config(typeof(BenchmarkConfiguration))]
|
||||
public class PreResolved
|
||||
{
|
||||
IUnityContainer _container;
|
||||
object _syncRoot = new object();
|
||||
|
||||
[IterationSetup]
|
||||
public virtual void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer().AddExtension(new ForceActivation());
|
||||
|
||||
_container.RegisterType<Poco>();
|
||||
_container.RegisterType<IFoo, Foo>();
|
||||
_container.RegisterType<IFoo, Foo>("1");
|
||||
_container.RegisterFactory<IFoo>("2", c => new Foo());
|
||||
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
_container.Resolve<object>();
|
||||
_container.Resolve<Poco>();
|
||||
_container.Resolve<IFoo>();
|
||||
_container.Resolve<IFoo>("1");
|
||||
_container.Resolve<IFoo>("2");
|
||||
}
|
||||
}
|
||||
|
||||
[Benchmark(Description = "Resolve<IUnityContainer> ")]
|
||||
public object UnityContainer() => _container.Resolve(typeof(IUnityContainer), null);
|
||||
|
||||
[Benchmark(Description = "PreResolved<object> (optimized)")]
|
||||
public object Unregistered() => _container.Resolve(typeof(object), null);
|
||||
|
||||
[Benchmark(Description = "PreResolved<Poco> (optimized)")]
|
||||
public object Transient() => _container.Resolve(typeof(Poco), null);
|
||||
|
||||
[Benchmark(Description = "PreResolved<IService> (optimized)")]
|
||||
public object Mapping() => _container.Resolve(typeof(IFoo), null);
|
||||
|
||||
[Benchmark(Description = "Compiled<IService> (legacy)")]
|
||||
public object LegacyFactory() => _container.Resolve(typeof(IFoo), "2");
|
||||
|
||||
[Benchmark(Description = "PreResolved<IService[]> (optimized)")]
|
||||
public object Array() => _container.Resolve(typeof(IFoo[]), null);
|
||||
|
||||
[Benchmark(Description = "PreResolved<IEnumerable<IService>> (optimized)")]
|
||||
public object Enumerable() => _container.Resolve(typeof(IEnumerable<IFoo>), null);
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
using System;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Runner.Setup;
|
||||
using System.Linq;
|
||||
using Unity;
|
||||
|
||||
namespace Runner.Tests
|
||||
{
|
||||
[BenchmarkCategory("Registration")]
|
||||
[Config(typeof(BenchmarkConfiguration))]
|
||||
public class Registration
|
||||
{
|
||||
IUnityContainer _container;
|
||||
object _syncRoot = new object();
|
||||
|
||||
[IterationSetup]
|
||||
public virtual void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer();
|
||||
}
|
||||
|
||||
[Benchmark(Description = "Register (No Mapping)")]
|
||||
public object Register() => _container.RegisterType((Type)null, typeof(object), null, null);
|
||||
|
||||
[Benchmark(Description = "Register Mapping")]
|
||||
public object RegisterMapping() => _container.RegisterType(typeof(IFoo), typeof(Foo), null, null);
|
||||
|
||||
[Benchmark(Description = "Register Instance")]
|
||||
public object RegisterInstance() => _container.RegisterInstance(null, null, _syncRoot, null);
|
||||
|
||||
[Benchmark(Description = "Registrations.ToArray()")]
|
||||
public object Registrations() => _container.Registrations.ToArray();
|
||||
|
||||
[Benchmark(Description = "IsRegistered (True)")]
|
||||
public object IsRegistered() => _container.IsRegistered(typeof(IUnityContainer));
|
||||
|
||||
[Benchmark(Description = "IsRegistered (False)")]
|
||||
public object IsRegisteredFalse() => _container.IsRegistered(typeof(IFoo));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
|
||||
namespace Performance.Tests
|
||||
{
|
||||
public class Registration : RegistrationBase
|
||||
{
|
||||
[Benchmark(Description = "Register (No Mapping)", OperationsPerInvoke = 100)]
|
||||
public override object Register() => base.Register();
|
||||
|
||||
[Benchmark(Description = "Register Mapping", OperationsPerInvoke = 100)]
|
||||
public override object RegisterMapping() => base.RegisterMapping();
|
||||
|
||||
[Benchmark(Description = "Register Instance", OperationsPerInvoke = 100)]
|
||||
public override object RegisterInstance() => base.RegisterInstance();
|
||||
|
||||
[Benchmark(Description = "Registrations.ToArray(100)", OperationsPerInvoke = 100)]
|
||||
public override object Registrations() => base.Registrations();
|
||||
|
||||
[Benchmark(Description = "IsRegistered (True)", OperationsPerInvoke = 100)]
|
||||
public override object IsRegistered() => base.IsRegistered();
|
||||
|
||||
[Benchmark(Description = "IsRegistered (False)", OperationsPerInvoke = 100)]
|
||||
public override object IsRegisteredFalse() => base.IsRegisteredFalse();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Unity;
|
||||
|
||||
namespace Performance.Tests
|
||||
{
|
||||
public class Compiled : BasicBase
|
||||
{
|
||||
const string name = nameof(Compiled);
|
||||
|
||||
[IterationSetup]
|
||||
public override void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer().AddExtension(new ForceCompillation());
|
||||
|
||||
base.SetupContainer();
|
||||
}
|
||||
|
||||
[Benchmark(Description = "(" + name + ") IUnityContainer", OperationsPerInvoke = 20)]
|
||||
public override object UnityContainer() => base.UnityContainer();
|
||||
|
||||
[Benchmark(Description = " IUnityContainerAsync", OperationsPerInvoke = 20)]
|
||||
public override object UnityContainerAsync() => base.UnityContainerAsync();
|
||||
|
||||
[Benchmark(Description = "Factory (c,t,n)=>new Foo()", OperationsPerInvoke = 20)]
|
||||
public override object Factory() => base.Factory();
|
||||
|
||||
[Benchmark(Description = "Factory (with name)", OperationsPerInvoke = 20)]
|
||||
public override object LegacyFactory() => base.LegacyFactory();
|
||||
|
||||
[Benchmark(Description = "Instance", OperationsPerInvoke = 20)]
|
||||
public override object Instance() => base.Instance();
|
||||
|
||||
[Benchmark(Description = "Unregistered type", OperationsPerInvoke = 20)]
|
||||
public override object Unregistered() => base.Unregistered();
|
||||
|
||||
[Benchmark(Description = "Registered type with dependencies", OperationsPerInvoke = 20)]
|
||||
public override object Transient() => base.Transient();
|
||||
|
||||
[Benchmark(Description = "Registered interface to type mapping", OperationsPerInvoke = 20)]
|
||||
public override object Mapping() => base.Mapping();
|
||||
|
||||
[Benchmark(Description = "Mapping to Singleton", OperationsPerInvoke = 20)]
|
||||
public override object MappingToSingleton() => base.MappingToSingleton();
|
||||
|
||||
[Benchmark(Description = "Registered generic type mapping", OperationsPerInvoke = 20)]
|
||||
public override object GenericInterface() => base.GenericInterface();
|
||||
|
||||
[Benchmark(Description = "Array", OperationsPerInvoke = 20)]
|
||||
public override object Array() => base.Array();
|
||||
|
||||
[Benchmark(Description = "Enumerable", OperationsPerInvoke = 20)]
|
||||
public override object Enumerable() => base.Enumerable();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Unity;
|
||||
|
||||
namespace Performance.Tests
|
||||
{
|
||||
public class PreCompiled : BasicBase
|
||||
{
|
||||
const string name = nameof(PreCompiled);
|
||||
|
||||
[IterationSetup]
|
||||
public override void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer().AddExtension(new ForceCompillation());
|
||||
|
||||
base.SetupContainer();
|
||||
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
base.UnityContainer();
|
||||
base.UnityContainerAsync();
|
||||
base.LegacyFactory();
|
||||
base.Factory();
|
||||
base.Instance();
|
||||
base.Unregistered();
|
||||
base.Transient();
|
||||
base.Mapping();
|
||||
base.MappingToSingleton();
|
||||
base.GenericInterface();
|
||||
base.Array();
|
||||
base.Enumerable();
|
||||
}
|
||||
}
|
||||
|
||||
[Benchmark(Description = "(" + name + ") IUnityContainer", OperationsPerInvoke = 20)]
|
||||
public override object UnityContainer() => base.UnityContainer();
|
||||
|
||||
[Benchmark(Description = " IUnityContainerAsync", OperationsPerInvoke = 20)]
|
||||
public override object UnityContainerAsync() => base.UnityContainerAsync();
|
||||
|
||||
[Benchmark(Description = "Factory (c,t,n)=>new Foo()", OperationsPerInvoke = 20)]
|
||||
public override object Factory() => base.Factory();
|
||||
|
||||
[Benchmark(Description = "Factory (with name)", OperationsPerInvoke = 20)]
|
||||
public override object LegacyFactory() => base.LegacyFactory();
|
||||
|
||||
[Benchmark(Description = "Instance", OperationsPerInvoke = 20)]
|
||||
public override object Instance() => base.Instance();
|
||||
|
||||
[Benchmark(Description = "Unregistered type", OperationsPerInvoke = 20)]
|
||||
public override object Unregistered() => base.Unregistered();
|
||||
|
||||
[Benchmark(Description = "Registered type with dependencies", OperationsPerInvoke = 20)]
|
||||
public override object Transient() => base.Transient();
|
||||
|
||||
[Benchmark(Description = "Registered interface to type mapping", OperationsPerInvoke = 20)]
|
||||
public override object Mapping() => base.Mapping();
|
||||
|
||||
[Benchmark(Description = "Mapping to Singleton", OperationsPerInvoke = 20)]
|
||||
public override object MappingToSingleton() => base.MappingToSingleton();
|
||||
|
||||
[Benchmark(Description = "Registered generic type mapping", OperationsPerInvoke = 20)]
|
||||
public override object GenericInterface() => base.GenericInterface();
|
||||
|
||||
[Benchmark(Description = "Array", OperationsPerInvoke = 20)]
|
||||
public override object Array() => base.Array();
|
||||
|
||||
[Benchmark(Description = "Enumerable", OperationsPerInvoke = 20)]
|
||||
public override object Enumerable() => base.Enumerable();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Unity;
|
||||
|
||||
namespace Performance.Tests
|
||||
{
|
||||
public class PreResolved : BasicBase
|
||||
{
|
||||
const string name = nameof(PreResolved);
|
||||
|
||||
[IterationSetup]
|
||||
public override void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer().AddExtension(new ForceActivation());
|
||||
|
||||
base.SetupContainer();
|
||||
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
base.UnityContainer();
|
||||
base.LegacyFactory();
|
||||
base.Factory();
|
||||
base.Instance();
|
||||
base.Unregistered();
|
||||
base.Transient();
|
||||
base.Mapping();
|
||||
base.MappingToSingleton();
|
||||
base.GenericInterface();
|
||||
base.Array();
|
||||
base.Enumerable();
|
||||
}
|
||||
}
|
||||
|
||||
[Benchmark(Description = "(" + name + ") IUnityContainer", OperationsPerInvoke = 20)]
|
||||
public override object UnityContainer() => base.UnityContainer();
|
||||
|
||||
[Benchmark(Description = " IUnityContainerAsync", OperationsPerInvoke = 20)]
|
||||
public override object UnityContainerAsync() => base.UnityContainerAsync();
|
||||
|
||||
[Benchmark(Description = "Factory (c,t,n)=>new Foo()", OperationsPerInvoke = 20)]
|
||||
public override object Factory() => base.Factory();
|
||||
|
||||
[Benchmark(Description = "Factory (with name)", OperationsPerInvoke = 20)]
|
||||
public override object LegacyFactory() => base.LegacyFactory();
|
||||
|
||||
[Benchmark(Description = "Instance", OperationsPerInvoke = 20)]
|
||||
public override object Instance() => base.Instance();
|
||||
|
||||
[Benchmark(Description = "Unregistered type", OperationsPerInvoke = 20)]
|
||||
public override object Unregistered() => base.Unregistered();
|
||||
|
||||
[Benchmark(Description = "Registered type with dependencies", OperationsPerInvoke = 20)]
|
||||
public override object Transient() => base.Transient();
|
||||
|
||||
[Benchmark(Description = "Registered interface to type mapping", OperationsPerInvoke = 20)]
|
||||
public override object Mapping() => base.Mapping();
|
||||
|
||||
[Benchmark(Description = "Registered generic type mapping", OperationsPerInvoke = 20)]
|
||||
public override object GenericInterface() => base.GenericInterface();
|
||||
|
||||
[Benchmark(Description = "Mapping to Singleton", OperationsPerInvoke = 20)]
|
||||
public override object MappingToSingleton() => base.MappingToSingleton();
|
||||
|
||||
[Benchmark(Description = "Array", OperationsPerInvoke = 20)]
|
||||
public override object Array() => base.Array();
|
||||
|
||||
[Benchmark(Description = "Enumerable", OperationsPerInvoke = 20)]
|
||||
public override object Enumerable() => base.Enumerable();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Unity;
|
||||
|
||||
namespace Performance.Tests
|
||||
{
|
||||
public class Resolved : BasicBase
|
||||
{
|
||||
const string name = nameof(Resolved);
|
||||
|
||||
[IterationSetup]
|
||||
public override void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer().AddExtension(new ForceActivation());
|
||||
|
||||
base.SetupContainer();
|
||||
}
|
||||
|
||||
[Benchmark(Description = "(" + name + ") IUnityContainer", OperationsPerInvoke = 20)]
|
||||
public override object UnityContainer() => base.UnityContainer();
|
||||
|
||||
[Benchmark(Description = " IUnityContainerAsync", OperationsPerInvoke = 20)]
|
||||
public override object UnityContainerAsync() => base.UnityContainerAsync();
|
||||
|
||||
[Benchmark(Description = "Factory (c,t,n)=>new Foo()", OperationsPerInvoke = 20)]
|
||||
public override object Factory() => base.Factory();
|
||||
|
||||
[Benchmark(Description = "Factory (with name)", OperationsPerInvoke = 20)]
|
||||
public override object LegacyFactory() => base.LegacyFactory();
|
||||
|
||||
[Benchmark(Description = "Instance", OperationsPerInvoke = 20)]
|
||||
public override object Instance() => base.Instance();
|
||||
|
||||
[Benchmark(Description = "Unregistered type", OperationsPerInvoke = 20)]
|
||||
public override object Unregistered() => base.Unregistered();
|
||||
|
||||
[Benchmark(Description = "Registered type with dependencies", OperationsPerInvoke = 20)]
|
||||
public override object Transient() => base.Transient();
|
||||
|
||||
[Benchmark(Description = "Registered interface to type mapping", OperationsPerInvoke = 20)]
|
||||
public override object Mapping() => base.Mapping();
|
||||
|
||||
[Benchmark(Description = "Registered generic type mapping", OperationsPerInvoke = 20)]
|
||||
public override object GenericInterface() => base.GenericInterface();
|
||||
|
||||
[Benchmark(Description = "Mapping to Singleton", OperationsPerInvoke = 20)]
|
||||
public override object MappingToSingleton() => base.MappingToSingleton();
|
||||
|
||||
[Benchmark(Description = "Array", OperationsPerInvoke = 20)]
|
||||
public override object Array() => base.Array();
|
||||
|
||||
[Benchmark(Description = "Enumerable", OperationsPerInvoke = 20)]
|
||||
public override object Enumerable() => base.Enumerable();
|
||||
}
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using Runner.Setup;
|
||||
using System.Collections.Generic;
|
||||
using Unity;
|
||||
using Unity.Builder;
|
||||
|
||||
namespace Runner.Tests
|
||||
{
|
||||
[BenchmarkCategory("Basic")]
|
||||
[Config(typeof(BenchmarkConfiguration))]
|
||||
public class Resolved
|
||||
{
|
||||
IUnityContainer _container;
|
||||
object _syncRoot = new object();
|
||||
|
||||
[IterationSetup]
|
||||
public virtual void SetupContainer()
|
||||
{
|
||||
_container = new UnityContainer().AddExtension(new ForceActivation());
|
||||
|
||||
_container.RegisterType<Poco>();
|
||||
_container.RegisterType<IFoo, Foo>();
|
||||
_container.RegisterType<IFoo, Foo>("1");
|
||||
_container.RegisterFactory<IFoo>("2", c => new Foo());
|
||||
}
|
||||
|
||||
[Benchmark(Description = "Resolve<IUnityContainer> ")]
|
||||
public object UnityContainer() => _container.Resolve(typeof(IUnityContainer), null);
|
||||
|
||||
[Benchmark(Description = "Resolved<object> (unregistered)")]
|
||||
public object Unregistered() => _container.Resolve(typeof(object), null);
|
||||
|
||||
[Benchmark(Description = "Resolved<Poco> (registered)")]
|
||||
public object Transient() => _container.Resolve(typeof(Poco), null);
|
||||
|
||||
[Benchmark(Description = "Resolved<IService> (registered)")]
|
||||
public object Mapping() => _container.Resolve(typeof(IFoo), null);
|
||||
|
||||
[Benchmark(Description = "Compiled<IService> (legacy)")]
|
||||
public object LegacyFactory() => _container.Resolve(typeof(IFoo), "2");
|
||||
|
||||
[Benchmark(Description = "Resolved<IService[]> (registered)")]
|
||||
public object Array() => _container.Resolve(typeof(IFoo[]), null);
|
||||
|
||||
[Benchmark(Description = "Resolved<IEnumerable<IService>> (registered)")]
|
||||
public object Enumerable() => _container.Resolve(typeof(IEnumerable<IFoo>), null);
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
using Unity;
|
||||
|
||||
namespace Runner.Tests
|
||||
{
|
||||
|
||||
public class Poco
|
||||
{
|
||||
[Dependency]
|
||||
public object Dependency { get; set; }
|
||||
|
||||
[InjectionMethod]
|
||||
public object CallMe([Dependency]object data) => data;
|
||||
}
|
||||
|
||||
|
||||
public interface IFoo { }
|
||||
|
||||
public class Foo : IFoo
|
||||
{
|
||||
[Dependency]
|
||||
public object Dependency { get; set; }
|
||||
|
||||
[InjectionMethod]
|
||||
public object CallMe([Dependency]object data) => data;
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче