Exemplo n.º 1
0
        public void EndLengthLargest()
        {
            MaxEnd3 output = new MaxEnd3();

            CollectionAssert.AreEqual(new int[] { 7, 7, 7 }, output.MakeArray(new int[] { 4, 19, 7 }));
            CollectionAssert.AreEqual(new int[] { 8, 8, 8 }, output.MakeArray(new int[] { 5, 2, 8 }));
        }
Exemplo n.º 2
0
        public void SameStartAndEnd()
        {
            MaxEnd3 output = new MaxEnd3();                                                             //arrange

            CollectionAssert.AreEqual(new int[] { 5, 5, 5 }, output.MakeArray(new int[] { 5, 15, 5 })); //assert/act
            CollectionAssert.AreEqual(new int[] { 9, 9, 9 }, output.MakeArray(new int[] { 9, 1, 9 }));
        }
Exemplo n.º 3
0
        public void StartLengthLargets()
        {
            MaxEnd3 output = new MaxEnd3();

            CollectionAssert.AreEqual(new int[] { 9, 9, 9 }, output.MakeArray(new int[] { 9, 7, 6 }));
            CollectionAssert.AreEqual(new int[] { 11, 11, 11 }, output.MakeArray(new int[] { 11, 13, 1 }));
        }
Exemplo n.º 4
0
        public void MaxEnd3()
        {
            MaxEnd3 testMaxEnd3 = new MaxEnd3();

            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, testMaxEnd3.MakeArray(new int[] { 1, 2, 3 }), "Test 1: Input was [1, 2, 3]");
            CollectionAssert.AreEqual(new int[] { 11, 11, 11 }, testMaxEnd3.MakeArray(new int[] { 11, 5, 9 }), "Test 2: Input was [11, 5, 9]");
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, testMaxEnd3.MakeArray(new int[] { 2, 11, 3 }), "Test 3: Input was [2, 11, 3]");
        }
Exemplo n.º 5
0
        public void MakeArray(int[] nums, int[] expected)
        {
            MaxEnd3 ex = new MaxEnd3();

            int[] actualResult = ex.MakeArray(nums);

            CollectionAssert.AreEqual(expected, actualResult);
        }
Exemplo n.º 6
0
        public void MaxEnd3Test()
        {
            MaxEnd3 newMax = new MaxEnd3();

            CollectionAssert.AreEqual(new int[] { 3, 3, 3, 3 }, newMax.MakeArray(new int[] { 0, 2, 2, 3 }));
            CollectionAssert.AreEqual(new int[] { 5, 5 }, newMax.MakeArray(new int[] { 2, 5 }));
            CollectionAssert.AreEqual(new int[] { 10, 10, 10, 10, 10 }, newMax.MakeArray(new int[] { 8, 3, 2, 4, 10 }));
        }
        public void MaxEndTest()
        {
            MaxEnd3 myMax = new MaxEnd3();

            CollectionAssert.AreEquivalent(new int[] { 3, 3, 3 }, myMax.MakeArray(new int[] { 1, 2, 3 }));
            CollectionAssert.AreEquivalent(new int[] { 21, 21, 21 }, myMax.MakeArray(new int[] { 21, 4, 6 }));
            CollectionAssert.AreEquivalent(new int[] { 6, 6, 6 }, myMax.MakeArray(new int[] { 6, 4, 2 }));
        }
Exemplo n.º 8
0
        public void TesthMaxEnd3GivenNull()
        {
            MaxEnd3 happyPath = new MaxEnd3();

            int[] listOfNums = null;

            Assert.AreEqual(null, happyPath.MakeArray(listOfNums));
        }
        public void MakeArrayTest()
        {
            MaxEnd3 myMaxEnd3 = new MaxEnd3();

            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, myMaxEnd3.MakeArray(new int[] { 1, 2, 3 }));
            CollectionAssert.AreEqual(new int[] { 11, 11, 11 }, myMaxEnd3.MakeArray(new int[] { 11, 5, 9 }));
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, myMaxEnd3.MakeArray(new int[] { 2, 11, 3 }));
        }
Exemplo n.º 10
0
        public void MaxEnd3GoodTest()
        {
            MaxEnd3 myArray = new MaxEnd3();

            int[] expectedResult = new int[] { 3, 3, 3 };
            int[] array          = new int[] { 1, 2, 3 };
            int[] match          = myArray.MakeArray(array);
            CollectionAssert.AreEquivalent(expectedResult, match);
        }
Exemplo n.º 11
0
        public void MakeArrayTest2113()
        {
            MaxEnd3 maxEnd3 = new MaxEnd3();

            int[] first    = { 2, 11, 3, };
            int[] expected = { 3, 3, 3 };
            int[] result   = maxEnd3.MakeArray(first);
            CollectionAssert.AreEqual(expected, result);
        }
Exemplo n.º 12
0
        public void MakeArrayTest1159()
        {
            MaxEnd3 maxEnd3 = new MaxEnd3();

            int[] first    = { 11, 5, 9, };
            int[] expected = { 11, 11, 11 };
            int[] result   = maxEnd3.MakeArray(first);
            CollectionAssert.AreEqual(expected, result);
        }
Exemplo n.º 13
0
        public void EndSameSizesTest()
        {
            //Arrange
            MaxEnd3 exercises = new MaxEnd3();

            //Assert
            CollectionAssert.AreEqual(new int[] { 10, 10, 10 }, exercises.MakeArray(new int[] { 10, 0, 10 }));
            CollectionAssert.AreEqual(new int[] { 10, 10, 10 }, exercises.MakeArray(new int[] { 10, 20, 10 }));
        }
Exemplo n.º 14
0
        public void EndLargerTest()
        {
            //Arrange
            MaxEnd3 exercises = new MaxEnd3();

            //Assert
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, exercises.MakeArray(new int[] { 1, 0, 3 }));
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, exercises.MakeArray(new int[] { 1, 10, 3 }));
        }
Exemplo n.º 15
0
        public void BeginningLargerTest()
        {
            //Arrange
            MaxEnd3 exercises = new MaxEnd3();

            //Assert
            CollectionAssert.AreEqual(new int[] { 13, 13, 13 }, exercises.MakeArray(new int[] { 13, 0, 3 }));
            CollectionAssert.AreEqual(new int[] { 13, 13, 13 }, exercises.MakeArray(new int[] { 13, 20, 3 }));
        }
Exemplo n.º 16
0
        public void MakeArray_123_333()
        {
            MaxEnd3 maxEnd3 = new MaxEnd3();

            int[] input    = { 1, 2, 3 };
            int[] result   = maxEnd3.MakeArray(input);
            int[] expected = { 3, 3, 3 };
            CollectionAssert.AreEqual(expected, result);
        }
Exemplo n.º 17
0
        public void MaxEndTest3()
        {
            int[]   input   = { 2, 11, 3 };
            MaxEnd3 maxEnd3 = new MaxEnd3();

            int[] actual = maxEnd3.MakeArray(input);

            int[] expected = { 3, 3, 3 };
            Assert.AreEqual(true, actual.SequenceEqual(expected));
        }
        public void MakeArrayTest()
        {
            var exercise = new MaxEnd3();

            //MakeArray([1, 2, 3]) → [3, 3, 3]
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, exercise.MakeArray(new int[] { 1, 2, 3 }));
            //MakeArray([11, 5, 9]) → [11, 11, 11]
            CollectionAssert.AreEqual(new int[] { 11, 11, 11 }, exercise.MakeArray(new int[] { 11, 5, 9 }));
            //MakeArray([2, 11, 3]) → [3, 3, 3]
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, exercise.MakeArray(new int[] { 2, 11, 3 }));
        }
Exemplo n.º 19
0
        public void DataTestMakeArray(int[] input1, int[] expectedResult)
        {
            // Arrange
            MaxEnd3 ex = new MaxEnd3();

            // Act
            int[] actualResult = ex.MakeArray(input1);

            //Assert
            CollectionAssert.AreEqual(expectedResult, actualResult);
        }
Exemplo n.º 20
0
        public void MakeArray()
        {
            // Arrange
            MaxEnd3 ex = new MaxEnd3();

            // Act
            int[] actualResult = ex.MakeArray(new int[] { 1, 2, 3 });

            // Assert
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, actualResult);
        }
Exemplo n.º 21
0
        public void DoesItReturnTriple5()
        {
            //Arrange
            MaxEnd3 max = new MaxEnd3();

            int[] input       = { 5, 2, 5 };
            int[] expectation = { 5, 5, 5 };
            //Act
            int[] result = max.MakeArray(input);
            //Assert
            CollectionAssert.AreEqual(expectation, result);
        }
Exemplo n.º 22
0
        public void MakeArray3Tests()
        {
            //Arrange
            MaxEnd3 max3Array = new MaxEnd3();

            //Act
            int[] beginningLarger  = max3Array.MakeArray(new int[] { 10, 0, 10 });
            int[] beginning2Larger = max3Array.MakeArray(new int[] { 10, 20, 10 });

            //Assert
            CollectionAssert.AreEqual(new int[] { 10, 10, 10 }, beginningLarger);
            CollectionAssert.AreEqual(new int[] { 10, 10, 10 }, beginning2Larger);
        }
Exemplo n.º 23
0
        //end is larger
        public void MakeArrayTests()

        {
            //Arrange
            MaxEnd3 maxarray = new MaxEnd3();

            //Act
            int[] endLarger  = maxarray.MakeArray(new int[] { 1, 0, 3 });
            int[] end2Larger = maxarray.MakeArray(new int[] { 1, 10, 3 });

            //Assert
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, endLarger);
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, end2Larger);
        }
Exemplo n.º 24
0
        public void ShouldSetAllValuesEqualToLastValue()
        {
            //arrange
            MaxEnd3 allSet = new MaxEnd3();

            int[] numbers        = { 19, 5, 1738 };
            int[] correctNumbers = { 1738, 1738, 1738 };

            //act
            int[] newNumbers = allSet.MakeArray(numbers);

            //assert
            Assert.ReferenceEquals(correctNumbers, newNumbers);
        }
Exemplo n.º 25
0
        public void Check_Last_Index_Make_New_Array_With_Bigger_Number()
        {
            //Arrange
            MaxEnd3 testMethod = new MaxEnd3();

            int[] array1        = new int[] { 0, 5, 11 };
            int[] expectedArray = new[] { 11, 11, 11 };

            //Act
            int[] resultArray = testMethod.MakeArray(array1);


            //Assert
            CollectionAssert.AreEqual(expectedArray, resultArray);
        }
Exemplo n.º 26
0
        public void First_Index_And_Last_Index_Are_Same()
        {
            //Arrange
            MaxEnd3 testMethod = new MaxEnd3();

            int[] array1        = new int[] { 0, 5, 0 };
            int[] expectedArray = new[] { 0, 0, 0 };

            //Act
            int[] resultArray = testMethod.MakeArray(array1);


            //Assert
            CollectionAssert.AreEqual(expectedArray, resultArray);
        }
Exemplo n.º 27
0
        public void MakeArrayVariables()
        {
            int[] miaw  = { 1, 1000, 0 };
            int[] miaw2 = { 10000, 5, -10001 };
            int[] miaw3 = { 0, 0, 0 };

            int[] answer  = { 1, 1, 1 };
            int[] answer2 = { 10000, 10000, 10000 };
            int[] answer3 = { 0, 0, 0 };

            MaxEnd3 lae = new MaxEnd3();

            CollectionAssert.AreEqual(answer, lae.MakeArray(miaw));
            CollectionAssert.AreEqual(answer2, lae.MakeArray(miaw2));
            CollectionAssert.AreEqual(answer3, lae.MakeArray(miaw3));
        }
Exemplo n.º 28
0
        public void MakeArray()
        {
            int[] miaw  = { 1, 2, 3 };
            int[] miaw2 = { 11, 5, 9 };
            int[] miaw3 = { 2, 11, 3 };

            int[] answer  = { 3, 3, 3 };
            int[] answer2 = { 11, 11, 11 };
            int[] answer3 = { 3, 3, 3 };

            MaxEnd3 lae = new MaxEnd3();

            CollectionAssert.AreEqual(answer, lae.MakeArray(miaw));
            CollectionAssert.AreEqual(answer2, lae.MakeArray(miaw2));
            CollectionAssert.AreEqual(answer3, lae.MakeArray(miaw3));
        }
Exemplo n.º 29
0
        public void TestHappyPathMaxEnd3()
        {
            MaxEnd3      happyPath  = new MaxEnd3();
            List <int[]> listOfNums = new List <int[]>
            {
                new int[] { 1, 2, 3 },
                new int[] { 1, 1, 2 },
                new int[] { 2, 6, 3 },
                new int[] { 3, 3, 3 },
                new int[] { 2, 2, 2 }
            };

            CollectionAssert.AreEqual(listOfNums[3], happyPath.MakeArray(listOfNums[0]));
            CollectionAssert.AreEqual(listOfNums[4], happyPath.MakeArray(listOfNums[1]));
            CollectionAssert.AreEqual(listOfNums[3], happyPath.MakeArray(listOfNums[2]));
        }
Exemplo n.º 30
0
        public void RepeatValues()
        {
            MaxEnd3 repeats = new MaxEnd3();

            int[] result = repeats.MakeArray(new int[] { 1, 2, 3 });
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, result);

            MaxEnd3 repeatsAgain = new MaxEnd3();

            int[] result2 = repeatsAgain.MakeArray(new int[] { 11, 5, 9 });
            CollectionAssert.AreEqual(new int[] { 11, 11, 11 }, result2);

            MaxEnd3 repeatsTres = new MaxEnd3();

            int[] result3 = repeatsTres.MakeArray(new int[] { 2, 11, 3 });
            CollectionAssert.AreEqual(new int[] { 3, 3, 3 }, result3);
        }