コード例 #1
0
        public void GivenNegativeJumpDistance()
        {
            var x = Faker.Random.Int(2, 1000000000);
            var y = x - 1;

            Should.Throw <ArgumentException>(() => TestInstance.JumpCount(x, y, Faker.Random.Int(1, 1000000000)));
        }
コード例 #2
0
        public void GivenExampleJumpDistance()
        {
            const int x = 10;
            const int y = 85;
            const int d = 30;

            TestInstance.JumpCount(x, y, d).ShouldBe(3);
        }
コード例 #3
0
        public void GivenJumpDistanceZero()
        {
            var x = Faker.Random.Int(1, 1000000000);

            TestInstance.JumpCount(x, x, Faker.Random.Int(1, 1000000000)).ShouldBe(0);
        }
コード例 #4
0
 public void GivenJumpDistanceOutOfRange(int d)
 {
     Should.Throw <ArgumentOutOfRangeException>(
         () => TestInstance.JumpCount(Faker.Random.Int(1, 1000000000), Faker.Random.Int(1, 1000000000), d));
 }
コード例 #5
0
 public void GivenEndingPointOutOfRange(int y)
 {
     Should.Throw <ArgumentOutOfRangeException>(
         () => TestInstance.JumpCount(Faker.Random.Int(1, 1000000000), y, 1));
 }