예제 #1
0
 public void Test_3()
 {
     using (var app = new AzosApplication(null, BASE_CONF))
     {
         var obj = new NeedsBoth();
         app.InjectInto(obj);
         Aver.AreEqual(100, obj.A.ValueOfA);
         Aver.AreEqual(-1000, obj.B.ValueOfB);
     }
 }
예제 #2
0
        public void Test_4()
        {
            using (var app = new AzosApplication(null, BAD_CONF))
            {
                var obj = new NeedsBoth();
                try
                {
                    app.InjectInto(obj);
                }
                catch (DependencyInjectionException e)
                {
                    new WrappedExceptionData(e).See();
                    return;
                }

                Aver.Fail(Constants.ERR_NOT_THROWN); //because NeedsBoth requires A and B
            }
        }
예제 #3
0
        public void Test_4()
        {
            using (var app = new AzosApplication(null, BAD_CONF))
            {
                var obj = new NeedsBoth();
                try
                {
                    app.InjectInto(obj);
                }
                catch (DependencyInjectionException e)
                {
                    new WrappedExceptionData(e).See();
                    return;
                }

                Aver.Fail("Expected exception was not thrown"); //because NeedsBoth requires A and B
            }
        }