Beispiel #1
0
 public Person(string name, int age, ICanBePerson spouse, ICanBePerson mother)
 {
     Name         = name;
     PersonAge    = age;
     PersonSpouse = spouse;
     Mother       = mother;
 }
Beispiel #2
0
        public void For_Method_Returns_Correct_Component_When_Service_Is_Interface()
        {
            // arrange
            Dictionary <string, string> mappings = new Dictionary <string, string>
            {
                { "name", "name" },
                { "age", "age" }
            };

            // act
            var component = PropertyResolvingComponent.For <ICanBePerson>()
                            .ImplementedBy <Person>()
                            .DependsOn(mappings)
                            .WithLifestyle(LifestyleType.Transient);

            m_container.Register(component);

            // assert
            ICanBePerson person = m_container.Resolve <ICanBePerson>();

            Assert.IsInstanceOf <Person>(person);
        }
Beispiel #3
0
 public Person(string name, int age, ICanBePerson spouse)
 {
     Name         = name;
     PersonAge    = age;
     PersonSpouse = spouse;
 }