コード例 #1
0
ファイル: TestProgram.cs プロジェクト: dekkerb115/Bam.Net
        public static void FluentConstructorTests2()
        {
            Incubator withApple = Requesting.A <IFruit>().Returns <Apple>();

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

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

            Expect.IsTrue(g.Fruit.GetType() == typeof(Apple));
        }
コード例 #2
0
ファイル: TestProgram.cs プロジェクト: dekkerb115/Bam.Net
        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));
        }