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