Ejemplo n.º 1
0
            public static void Test()
            {
                IDerived x = new Derived {
                    V0 = 0, V1 = 1
                };

                Action TestCase(int testNo, object y, Type?expectedException = null) => () => {
                    TestAA
                    .Act(() => x.AssertIs(y))
                    .Assert(expectedException, message: $"No.{testNo}");
                };

                new[] {
                    TestCase(0, y: new { V1 = 1 }, expectedException: typeof(PrimitiveAssertFailedException)),   // y が IDerived のデータメンバーを全て実装していないので失敗すべき。
                    TestCase(1, y: new { V0 = 0, V1 = 1 }),
                }.Invoke();
            }