Exemplo n.º 1
0
        public static void FluentIncubatorTest()
        {
            Incubator i = Requesting.A <Primate>().Returns <Monkey>();
            Primate   m = i.Get <Primate>();

            Expect.IsTrue(m.GetType() == typeof(Monkey));
        }
Exemplo n.º 2
0
 protected bool OnRequesting(HttpRequest request, HttpResponse response)
 {
     if (Requesting != null)
     {
         EventRequestingArgs e = new EventRequestingArgs(request, response);
         e.Cancel = false;
         Requesting?.Invoke(this, e);
         return(!e.Cancel);
     }
     return(true);
 }
Exemplo n.º 3
0
        public static void FluentConstructorTests3()
        {
            Incubator withApple = Requesting.A <IFruit>().Returns <Apple>();

            withApple.Bind <Monkey>().To <Gorilla>();
            Primate p = withApple.Get <Monkey>();

            Expect.IsTrue(p is Gorilla);
            Gorilla g = (Gorilla)p;

            Expect.IsTrue(g.Fruit.GetType() == typeof(Apple));
        }
Exemplo n.º 4
0
        public static void FluentConstructorTests()
        {
            Incubator withBanana = Requesting.A <IFruit>().Returns <Banana>();

            withBanana.AskingFor <Primate>().Returns <Gorilla>();
            Primate p = withBanana.Get <Primate>();

            Expect.IsTrue(p is Gorilla);
            Gorilla g = (Gorilla)p;

            Expect.IsTrue(g.Fruit.GetType() == typeof(Banana));
        }