public void CreateInstanceWithNameTest()
        {
            //Arrange
            ServiceConcrete1 expected = new ServiceConcrete1();
            IService         actual;

            //Act
            actual = Factory.CreateInstanceWithName("ServiceConcrete2");

            //Assert
            Assert.AreEqual(expected.GetType(), actual.GetType());
        }
예제 #2
0
        public void GetFluentContainerNamedTest()
        {
            //Arrange
            ServiceConcrete1 expected = new ServiceConcrete1();
            var container             = DIHelper.GetFluentContainer();

            //Act
            IService actual = container.Resolve <IService>("ServiceConcrete2");

            //Assert
            Assert.IsNotNull(actual);
            Assert.AreEqual(expected.GetType(), actual.GetType());
        }
        public void MethodTestFluent()
        {
            //Arrange
            ServiceConcrete1 expected = new ServiceConcrete1();
            var container             = DIHelper.GetContainer();

            //Act
            ClientMethod actual = container.Resolve <ClientMethod>();

            //Assert
            Assert.IsNotNull(actual);
            Assert.AreEqual(expected.GetType(), actual.Service.GetType());
        }