Exemplo n.º 1
0
        public void HasBoth()
        {
            Lucky13 hasboth = new Lucky13();
            bool    result  = hasboth.GetLucky(new int[] { 1, 2, 3 });

            Assert.AreEqual(false, result);
        }
Exemplo n.º 2
0
        public void HasOnes()
        {
            Lucky13 hasOnes = new Lucky13();
            bool    result  = hasOnes.GetLucky(new int[] { 1, 2, 4 });

            Assert.AreEqual(false, result);
        }
Exemplo n.º 3
0
        public void NoOnesThrees()
        {
            Lucky13 noOnesThrees = new Lucky13();
            bool    result       = noOnesThrees.GetLucky(new int[] { 0, 2, 4 });

            Assert.AreEqual(true, result);
        }
        public void GetLuckyTest()
        {
            Lucky13 LuckyLuck = new Lucky13();

            Assert.AreEqual(true, LuckyLuck.GetLucky(new int[] { 4, 8, 9 }), "Input was [4, 8, 9]");
            Assert.AreEqual(false, LuckyLuck.GetLucky(new int[] { 1, 7, 6 }), "Input was [1, 7, 6]");
            Assert.AreEqual(false, LuckyLuck.GetLucky(new int[] { 2, 2, 3 }), "Input was [2, 2, 3]");
        }
Exemplo n.º 5
0
        public void GetLucky(int[] nums, bool expected)
        {
            Lucky13 ex = new Lucky13();

            bool actualResult = ex.GetLucky(nums);

            Assert.AreEqual(expected, actualResult);
        }
        public void GetLuckyTest124()
        {
            Lucky13 lucky13 = new Lucky13();

            bool result = lucky13.GetLucky(new int[] { 1, 2, 4 });

            Assert.AreEqual(false, result);
        }
        public void GetLuckyTest()
        {
            Lucky13 myLucky13 = new Lucky13();

            Assert.AreEqual(true, myLucky13.GetLucky(new int[] { 0, 2, 4 }));
            Assert.AreEqual(false, myLucky13.GetLucky(new int[] { 1, 2, 3 }));
            Assert.AreEqual(false, myLucky13.GetLucky(new int[] { 1, 2, 4 }));
        }
        public void GetLuckyTest()
        {
            Lucky13 lucky13 = new Lucky13();

            bool result = lucky13.GetLucky(new int[] { 0, 2, 4 });

            Assert.AreEqual(true, result);
        }
Exemplo n.º 9
0
        public void TestDoesContainOneOrThree()
        {
            Lucky13 values = new Lucky13();

            int[] nums = { 1, 4, 6, 3, 21, 64, 329 };

            Assert.IsFalse(values.GetLucky(nums));
        }
Exemplo n.º 10
0
        public void TestDoesNotContainOneOrThree()
        {
            Lucky13 values = new Lucky13();

            int[] nums = { 2, 4, 6, 9, 21, 33, 299 };

            Assert.IsTrue(values.GetLucky(nums));
        }
Exemplo n.º 11
0
        public void TestEmptyArray()
        {
            Lucky13 values = new Lucky13();

            int[] nums = null;

            Assert.IsFalse(values.GetLucky(nums));
        }
        public void Lucky13Test()
        {
            Lucky13 object13 = new Lucky13();

            Assert.AreEqual(true, object13.GetLucky(new int[] { 0, 2, 4 }));
            Assert.AreEqual(false, object13.GetLucky(new int[] { 1, 0, 2 }));
            Assert.AreEqual(false, object13.GetLucky(new int[] { 1, 3, 2 }));
        }
Exemplo n.º 13
0
        public void Lucky13()
        {
            Lucky13 testLucky13 = new Lucky13();

            Assert.AreEqual(true, testLucky13.GetLucky(new int[] { 0, 2, 4 }), "Test 1: Input was [0, 2, 4]");
            Assert.AreEqual(false, testLucky13.GetLucky(new int[] { 1, 2, 3 }), "Test 2: Input was [1, 2, 3]");
            Assert.AreEqual(false, testLucky13.GetLucky(new int[] { 1, 2, 4 }), "Test 3: Input was [1, 2, 4]");
            Assert.AreEqual(false, testLucky13.GetLucky(new int[] { 5, 2, 3 }), "Test 4: Input was [5, 2, 3]");
        }
Exemplo n.º 14
0
        public void Lucky13TestNotLucky2()
        {
            int[]   input   = { 1, 2, 4 };
            Lucky13 lucky13 = new Lucky13();

            bool actual = lucky13.GetLucky(input);

            Assert.AreEqual(false, actual);
        }
Exemplo n.º 15
0
        public void Lucky13TestIsLucky()
        {
            int[]   input   = { 0, 2, 4 };
            Lucky13 lucky13 = new Lucky13();

            bool actual = lucky13.GetLucky(input);

            Assert.AreEqual(true, actual);
        }
Exemplo n.º 16
0
        public void Lucky13Test014()
        {
            Lucky13 myArray = new Lucky13();

            int[] array = new int[] { 0, 1, 4 };
            bool  match = myArray.GetLucky(array);

            Assert.AreEqual(false, match);
        }
Exemplo n.º 17
0
        public void TheLuckyOne()
        {
            Lucky13 lucky = new Lucky13();

            //Assert
            Assert.AreEqual(true, lucky.GetLucky(new int[] { 0, 2, 6 }));
            Assert.AreEqual(true, lucky.GetLucky(new int[] { 2, 4, 8 }));
            Assert.AreEqual(true, lucky.GetLucky(new int[] { 0, 2 }));
        }
Exemplo n.º 18
0
        public void GetLucky2Tests()
        {
            //Arrange
            Lucky13 notLucky = new Lucky13();

            //Assert & Act
            Assert.AreEqual(false, notLucky.GetLucky(new int[] { 10, 2, 4, 1 }));
            Assert.AreEqual(false, notLucky.GetLucky(new int[] { 1, 3 }));
        }
Exemplo n.º 19
0
        public void ArrayWithNo1sOr0s_ExpectTrue()
        {
            //Arrange
            Lucky13 lucky = new Lucky13();

            //Assert
            Assert.AreEqual(true, lucky.GetLucky(new int[] { 0, 2, 4 }));
            Assert.AreEqual(true, lucky.GetLucky(new int[] { }));
        }
        public void GetLucky_No1sNo3s_True()
        {
            Lucky13 lucky13 = new Lucky13();

            int[] nums   = { 0, 2, 4 };
            bool  result = lucky13.GetLucky(nums);

            Assert.AreEqual(true, result);
        }
Exemplo n.º 21
0
        public void OnesAndThrees()
        {
            Lucky13 unlucky = new Lucky13();

            //Assert
            Assert.AreEqual(false, unlucky.GetLucky(new int[] { 1, 1, 1 }));
            Assert.AreEqual(false, unlucky.GetLucky(new int[] { 3, 3, 3 }));
            Assert.AreEqual(false, unlucky.GetLucky(new int[] { 1, 3 }));
        }
Exemplo n.º 22
0
        public void ArrayWithAll1sOr0s_ExpectFalse()
        {
            //Arrange
            Lucky13 lucky = new Lucky13();

            //Assert
            Assert.AreEqual(false, lucky.GetLucky(new int[] { 1, 1, 1 }));
            Assert.AreEqual(false, lucky.GetLucky(new int[] { 3, 3, 3 }));
            Assert.AreEqual(false, lucky.GetLucky(new int[] { 1, 3 }));
        }
        public void GetLuckyTest()
        {
            var exercise = new Lucky13();

            //GetLucky([0, 2, 4]) → true
            Assert.AreEqual(true, exercise.GetLucky(new int[] { 0, 2, 4 }));
            //GetLucky([1, 2, 3]) → false
            Assert.AreEqual(false, exercise.GetLucky(new int[] { 1, 2, 3 }));
            //GetLucky([1, 2, 4]) → false
            Assert.AreEqual(false, exercise.GetLucky(new int[] { 1, 2, 4 }));
        }
Exemplo n.º 24
0
        public void GetLucky()
        {
            // Arrange
            Lucky13 ex = new Lucky13();

            // Act
            bool actualResult = ex.GetLucky(new int[] { 0, 2, 4 });

            // Assert
            Assert.AreEqual(true, actualResult);
        }
Exemplo n.º 25
0
        public void DataTestGetLucky(int[] input1, bool expectedResult)
        {
            // Arrange
            Lucky13 ex = new Lucky13();

            // Act
            bool actualResult = ex.GetLucky(input1);

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Exemplo n.º 26
0
        public void DoesArrayOfZerosContainOneOrThree()
        {
            //Arrange
            Lucky13 newArray = new Lucky13();

            int[] nums = { 0, 0, 0 };
            //Act
            bool result = newArray.GetLucky(nums);

            //Assert
            Assert.AreEqual(false, result);
        }
Exemplo n.º 27
0
        public void GetLucky()
        {
            int[] miaw  = { 0, 2, 4 };
            int[] miaw2 = { 1, 2, 3 };
            int[] miaw3 = { 1, 2, 4 };

            Lucky13 lae = new Lucky13();

            Assert.IsTrue(lae.GetLucky(miaw));
            Assert.IsFalse(lae.GetLucky(miaw2));
            Assert.IsFalse(lae.GetLucky(miaw3));
        }
Exemplo n.º 28
0
        public void GetLuckyVariables()
        {
            int[] miaw  = { 0, 0, 0 };
            int[] miaw2 = { -4, -2, -3 };
            int[] miaw3 = { -3, -3, 4 };

            Lucky13 lae = new Lucky13();

            Assert.IsTrue(lae.GetLucky(miaw));
            Assert.IsTrue(lae.GetLucky(miaw2));
            Assert.IsTrue(lae.GetLucky(miaw3));
        }
Exemplo n.º 29
0
        public void ShouldReturnFalseWhenInputIncludesOnlyThree()
        {
            //arrange
            Lucky13 oneOrThreeCheck = new Lucky13();

            int[] numbers = { 3, 12, 10, 803 };

            //act
            bool containsOneAndThree = oneOrThreeCheck.GetLucky(numbers);

            //assert
            Assert.AreEqual(false, containsOneAndThree);
        }
Exemplo n.º 30
0
        public void ShouldReturnTrueWhenInputIncludesNoOneAndThree()
        {
            //arrange
            Lucky13 oneOrThreeCheck = new Lucky13();

            int[] numbers = { 13, 2328, 34, 96 };

            //act
            bool containsOneAndThree = oneOrThreeCheck.GetLucky(numbers);

            //assert
            Assert.AreEqual(true, containsOneAndThree);
        }