Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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
            }
        }
Ejemplo n.º 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
            }
        }