示例#1
0
        public static void TestCreation()
        {
            var b = new Base(null, string.Empty);
                        var a = new Base(b, string.Empty);

                        Assert.AreEqual(a.HasRunner, false);
                        Assert.AreEqual(b.HasRunner, false);
                        Assert.AreEqual(a.Advance(), false);
                        Assert.AreEqual(b.Advance(), false);
                        Assert.AreEqual(a.Out(), false);
                        Assert.AreEqual(b.Out(), false);
        }
示例#2
0
        public static void TestRunners()
        {
            var b = new Base(null, string.Empty);
                        var a = new Base(b, string.Empty);

                        a.Land();
                        Assert.AreEqual(a.HasRunner, true);
                        Assert.AreEqual(b.HasRunner, false);

                        Assert.AreEqual(b.Advance(), false);
                        Assert.AreEqual(a.Advance(), true);
                        Assert.AreEqual(a.HasRunner, false);
                        Assert.AreEqual(b.HasRunner, true);

                        Assert.AreEqual(a.Advance(), false);
                        Assert.AreEqual(b.Advance(), true);
                        Assert.AreEqual(a.HasRunner, false);
                        Assert.AreEqual(b.HasRunner, false);

                        a.Error();
                        Assert.AreEqual(a.HasRunner, true);
                        Assert.AreEqual(b.HasRunner, false);

                        Assert.AreEqual(a.Out(), true);
                        Assert.AreEqual(a.Out(), false);
                        a.Land();
                        Assert.AreEqual(a.Out(), true);
                        Assert.AreEqual(a.Out(), false);

                        a.Land();
                        Assert.AreEqual(a.HasRunner, true);
                        Assert.AreEqual(b.HasRunner, false);
                        a.Clear();
                        Assert.AreEqual(a.HasRunner, false);
                        Assert.AreEqual(b.HasRunner, false);
        }