Esempio n. 1
0
        public void GenericParameterT3WithName()
        {
            // Setup
            Container.RegisterType(typeof(GenericService <, ,>),
                                   Invoke.Method("Method", Resolve.Generic("T3", "1")));

            // Act
            var result = Container.Resolve <GenericService <object, string, int> >();

            // Verify
            Assert.IsNotNull(result);
            Assert.AreEqual(result.Called, 3);
            Assert.AreEqual(result.Value, 1);
        }
        public void GenericParameterT1()
        {
            // Arrange
            Container.RegisterType(typeof(GenericService <, ,>),
                                   Invoke.Method("Method", Resolve.Generic("T1")));

            // Act
            var result = Container.Resolve <GenericService <object, string, int> >();

            // Verify
            Assert.IsNotNull(result);
            Assert.AreEqual(result.Called, 1);
            Assert.IsInstanceOfType(result.Value, typeof(object));
        }