Esempio n. 1
0
        public void Lucky13TestNo1No3()
        {
            int[] parameter = { 0, 2, 4 };
            bool  result    = thisLucky13.GetLucky(parameter);

            Assert.AreEqual(true, result);
        }
        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 }));
        }
Esempio n. 3
0
 public void Lucky13()
 {
     Assert.IsTrue(_lucky13.GetLucky(new[] { 0, 2, 4 }));
     Assert.IsFalse(_lucky13.GetLucky(new[] { 1, 2, 3 }));
     Assert.IsFalse(_lucky13.GetLucky(new[] { 1, 2, 4 }));
     Assert.IsTrue(_lucky13.GetLucky(new[] { -1, 2, 4 }));
     Assert.IsTrue(_lucky13.GetLucky(new[] { -1, -3, 4 }));
 }
        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]");
        }
Esempio n. 5
0
        public void ContainsNoOnesOrThrees(int[] input, bool expectededResult)
        {
            //----Act-----------------------------------------------
            bool isItTrue = testObj.GetLucky(input);

            //----Assert-------------------------------------------
            Assert.AreEqual(expectededResult, isItTrue);
        }
        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 }));
        }
Esempio n. 7
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[] { }));
        }
Esempio n. 8
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 }));
        }
Esempio n. 9
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 }));
        }
Esempio n. 10
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]");
        }
Esempio n. 11
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 }));
        }
Esempio n. 12
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 }));
        }
Esempio n. 14
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));
        }
Esempio n. 15
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));
        }
Esempio n. 16
0
        public void HasOnes()
        {
            Lucky13 hasOnes = new Lucky13();
            bool    result  = hasOnes.GetLucky(new int[] { 1, 2, 4 });

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

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

            int[] nums1 = { 0, 2, 4 };  // should return true
            int[] nums2 = { 1, 2, 3 };  // should return false
            int[] nums3 = { 1, 2, 4 };  // should return false

            bool result1 = lucky13.GetLucky(nums1);
            bool result2 = lucky13.GetLucky(nums2);
            bool result3 = lucky13.GetLucky(nums3);

            Assert.IsTrue(result1, "The array had no 1s or 3s, this should be true.");
            Assert.IsFalse(result2, "The array had a 3, this should be false.");
            Assert.IsFalse(result3, "The array has a 1, this should be false.");
        }
Esempio n. 19
0
        public void TestLucky13()
        {
            int[] array1  = { 0, 2, 4 };
            int[] array2  = { 1, 2, 3 };
            int[] array3  = { 1, 2, 4 };
            bool  actual  = lucky13.GetLucky(array1);
            bool  actual2 = lucky13.GetLucky(array2);
            bool  actual3 = lucky13.GetLucky(array3);

            //GetLucky([0, 2, 4]) → true
            //GetLucky([1, 2, 3]) → false
            //GetLucky([1, 2, 4]) → false
            Assert.AreEqual(true, actual);
            Assert.AreEqual(false, actual2);
            Assert.AreEqual(false, actual3);
        }
Esempio n. 20
0
        public void HasBoth()
        {
            Lucky13 hasboth = new Lucky13();
            bool    result  = hasboth.GetLucky(new int[] { 1, 2, 3 });

            Assert.AreEqual(false, result);
        }
Esempio n. 21
0
        public void TestEmptyArray()
        {
            Lucky13 values = new Lucky13();

            int[] nums = null;

            Assert.IsFalse(values.GetLucky(nums));
        }
Esempio n. 22
0
        public void TestDoesContainOneOrThree()
        {
            Lucky13 values = new Lucky13();

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

            Assert.IsFalse(values.GetLucky(nums));
        }
Esempio n. 23
0
        public void TestDoesNotContainOneOrThree()
        {
            Lucky13 values = new Lucky13();

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

            Assert.IsTrue(values.GetLucky(nums));
        }
Esempio n. 24
0
        public void GetLucky(int[] nums, bool expected)
        {
            Lucky13 ex = new Lucky13();

            bool actualResult = ex.GetLucky(nums);

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

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

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

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

            Assert.AreEqual(false, result);
        }
Esempio n. 27
0
        public void GetLuckyTests()
        {
            //Arrange
            Lucky13 goneLucky = new Lucky13();

            //Assert
            bool expectedResult  = goneLucky.GetLucky(new int[] { 0, 2, 4 });
            bool expected2Result = goneLucky.GetLucky(new int[] { 2, 5, 6, 4 });
            bool expected3Result = goneLucky.GetLucky(new int[] { 400, 5, 6, 7, 8, 9 });
            bool expected4Result = goneLucky.GetLucky(new int[] { 32, 13, 30 });


            //Act
            Assert.AreEqual(true, expectedResult);
            Assert.AreEqual(true, expected2Result);
            Assert.AreEqual(true, expected3Result);
            Assert.AreEqual(true, expected4Result);
        }
        public void Lucky13TestNotLucky2()
        {
            int[]   input   = { 1, 2, 4 };
            Lucky13 lucky13 = new Lucky13();

            bool actual = lucky13.GetLucky(input);

            Assert.AreEqual(false, actual);
        }
        public void GetLucky_No1sNo3s_True()
        {
            Lucky13 lucky13 = new Lucky13();

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

            Assert.AreEqual(true, result);
        }
Esempio n. 30
0
        public void Lucky13Test014()
        {
            Lucky13 myArray = new Lucky13();

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

            Assert.AreEqual(false, match);
        }