public void ResolveWithoutConcrete_Test() { IocFactory.Reset(); IocFactory.Register( Component.For <IMultipleParametersConstructor>().ImplementedBy <MultipleParametersConstructor>() ); IMultipleParametersConstructor person = IocFactory.Resolve <IMultipleParametersConstructor>(); }
public void MultipleParametersConstructors_Test() { IocFactory.Reset(); IocFactory.Register( Component.For <IMultipleParametersConstructor>().ImplementedBy <MultipleParametersConstructor>() ); IMultipleParametersConstructor constructor = IocFactory.Resolve <IMultipleParametersConstructor>(string.Empty, string.Empty, 66, "Banana"); Assert.IsNotNull(constructor); Assert.AreEqual("Banana", constructor.Fruta); }
public void UserTypeAndPrimitiveTypeConstructor_Test() { IocFactory.Reset(); IocFactory.Register( Component.For <IMultipleParametersConstructor>().ImplementedBy <MultipleParametersConstructor>() ); IUserPrincipal userPrincipal = new UserPrincipal(); userPrincipal.Login = "******"; string accessToken = Guid.NewGuid().ToString(); IMultipleParametersConstructor constructor = IocFactory.Resolve <IMultipleParametersConstructor>(userPrincipal, accessToken); Assert.IsNotNull(constructor); Assert.AreEqual("banana", userPrincipal.Login); }
public void Prepare() { IocFactory.Reset(); }