Example #1
0
        public void ObjectsAsNamedExplicitParameters()
        {
            var container = new Container();

            var param1 = new NotSimpleParameterClass()
            {
                ParameterValue = 11
            };
            var param2 = new NotSimpleParameterClass()
            {
                ParameterValue = 22
            };

            var complexObject = container.
                                With("objectOne").EqualTo(param1).
                                With("objectTwo").EqualTo(param2).
                                GetInstance <ComplexClass>();

            complexObject.ShouldNotBeNull();
            complexObject.ObjectOne.ShouldBe(param1);
            complexObject.ObjectTwo.ShouldBe(param2);
        }
Example #2
0
 public ComplexClass(NotSimpleParameterClass objectOne, NotSimpleParameterClass objectTwo)
 {
     ObjectOne = objectOne;
     ObjectTwo = objectTwo;
 }