Beispiel #1
0
        public void CreateUnitTest()
        {
            var k = new KanjiNumber();

            var list = (string[])k.AsDynamic().CreateUnit(3);

            Console.WriteLine(list[0]);

            Assert.IsTrue(list.Last() == "cz");
        }
Beispiel #2
0
        public void CreateUnitExTest()
        {
            TestContext.Run((int count) =>
            {
                var k  = new KanjiNumber();
                var ex = AssertEx.Throws <TargetInvocationException>(() =>
                {
                    var list = (string[])k.AsDynamic().CreateUnit(count);
                });

                (ex.InnerException is ArgumentOutOfRangeException).Is(true);

                Console.WriteLine(ex.InnerException.Message);
            });
        }