Ejemplo n.º 1
0
        public void NoOfTimesSeen_WithValidParameters2_ReturnsCorrectResult()
        {
            //act
            var x = BouncingBall.bouncingBall(30.0, 0.66, 1.5);

            //assert
            Assert.That(x, Is.EqualTo(15));
        }
Ejemplo n.º 2
0
        public void NoOfTimesSeen_WithInvalidBounceRate_ReturnsNegativeOne(double h, double bounce, double window)
        {
            //act
            var x = BouncingBall.bouncingBall(h, bounce, window);

            //assert
            Assert.That(x, Is.EqualTo(-1));
        }
Ejemplo n.º 3
0
        public void NoOfTimesSeen_WithInvalidWindowGreaterThanHeight_ReturnsNegativeOne(double h, double bounce, double window)
        {
            //act
            var x = BouncingBall.bouncingBall(4, 0.5, 5);

            //assert
            Assert.That(x, Is.EqualTo(-1));
        }
Ejemplo n.º 4
0
        public void NoOfTimesSeen_WithInvalidHeight_ReturnsNegativeOne()
        {
            //act
            var x = BouncingBall.bouncingBall(-1, 0.5, -2);

            //assert
            Assert.That(x, Is.EqualTo(-1));
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            BouncingBall dropTheBall = new BouncingBall();

            // test different cases here by changing inputs
            int result = dropTheBall.bouncingBall(3, 0.66, 1.5);

            // uncomment to see the result in the console
            // Console.WriteLine(result);
        }
Ejemplo n.º 6
0
 static void Main(string[] args)
 {
     Console.WriteLine(BouncingBall.bouncingBall(3.0, 0.66, 1.5));
     Console.ReadKey();
 }
Ejemplo n.º 7
0
 static void Main(string[] args)
 {
     //Console.WriteLine(Math.Log(1.5 / 3.0, 0.66));
     Console.WriteLine(BouncingBall.bouncingBall(30.0, 0.66, 1.5));
     Console.ReadKey();
 }
Ejemplo n.º 8
0
 public void Test2()
 {
     Assert.AreEqual(15, BouncingBall.bouncingBall(30.0, 0.66, 1.5));
 }
Ejemplo n.º 9
0
 public void Test1()
 {
     Assert.AreEqual(3, BouncingBall.bouncingBall(3.0, 0.66, 1.5));
 }
Ejemplo n.º 10
0
 public void Test9()
 {
     Assert.AreEqual(-1, BouncingBall.bouncingBall(5, -1, 1.5));
 }
Ejemplo n.º 11
0
 public void Test0()
 {
     Assert.AreEqual(1, BouncingBall.bouncingBall(2.0, 0.5, 1));
 }
Ejemplo n.º 12
0
 public void Test8()
 {
     Assert.AreEqual(-1, BouncingBall.bouncingBall(-5, 0.66, 1.5));
 }
Ejemplo n.º 13
0
 public void Test7()
 {
     Assert.AreEqual(-1, BouncingBall.bouncingBall(40, 1, 10));
 }
Ejemplo n.º 14
0
 public void Test6()
 {
     Assert.AreEqual(-1, BouncingBall.bouncingBall(10, 0.6, 10));
 }
Ejemplo n.º 15
0
 public void Test5()
 {
     Assert.AreEqual(3, BouncingBall.bouncingBall(40, 0.4, 10));
 }
Ejemplo n.º 16
0
 public void Test3()
 {
     Assert.AreEqual(21, BouncingBall.bouncingBall(30, 0.75, 1.5));
 }