コード例 #1
0
        public void Marc_Swims_Down()
        {
            var d = new Diver("Marc");

            Assert.Equal(0, d.GetPosition());

            d.SetDirectionDown();

            Assert.Equal(0, d.GetPosition());

            d.Swim();
            d.Swim();
            d.Swim();

            Assert.Equal(-3, d.GetPosition());
        }
コード例 #2
0
        public void Marc()
        {
            var d        = new Diver("Marc");
            int position = d.GetPosition();

            Assert.Equal(0, position);
        }
コード例 #3
0
        public void George_Swims_Down_and_Then_Up()
        {
            var d = new Diver("George");

            Assert.Equal(0, d.GetPosition());

            d.SetDirectionDown();

            Assert.Equal(0, d.GetPosition());

            d.Swim();
            d.Swim();
            d.Swim();
            d.Swim();
            d.Swim();

            Assert.Equal(-5, d.GetPosition());

            d.Swim();
            d.Swim();

            Assert.Equal(-7, d.GetPosition());

            d.SetDirectionUp();

            Assert.Equal(-7, d.GetPosition());

            d.Swim();
            d.Swim();

            Assert.Equal(-5, d.GetPosition());
        }