public void RegisterService_NoConstructorValid() { var container = new TinyContainer(); var typeInstance = new EmptyConreteType(); container.RegisterService <IInterfaceParam, InterfaceParam>(); container.RegisterService <ConcreteTypeMultiParam>(); var instance = container.ResolveService <ConcreteTypeMultiParam>(); }
public void RegisterSingleton_WithInstanceTest() { var container = new TinyContainer(); var typeInstance = new EmptyConreteType(); container.RegisterSingleton(typeInstance); var instance = container.ResolveService <EmptyConreteType>(); Assert.AreEqual(instance, typeInstance); }
public void RegisterService_OnlyOneConstructorValid() { var container = new TinyContainer(); var typeInstance = new EmptyConreteType(); container.RegisterService <SecondParam>(); container.RegisterService <IInterfaceParam, InterfaceParam>(); container.RegisterService <ConcreteTypeMultiParam>(); var instance = container.ResolveService <ConcreteTypeMultiParam>(); Assert.AreEqual(true, instance != null); }