Exemple #1
0
        public void ChangeValueOfSquareReturnsCorrectNumberOfChanges(string stringSequence, int changeValue, int expectedChangeValue)
        {
            MagicSquare square = new MagicSquare(stringSequence);

            square = square.ChangeValueOfSquareAtLocation(0, 0, changeValue);

            square.GetNumberOfChanges().Should().Be(expectedChangeValue);
        }
Exemple #2
0
        public void MultipleChangesOutputCorrectChangeValue()
        {
            MagicSquare square = new MagicSquare("4,9,2,3,5,7,8,1,5");

            square = square
                     .ChangeValueOfSquareAtLocation(0, 0, 5)
                     .ChangeValueOfSquareAtLocation(0, 0, 7)
                     .ChangeValueOfSquareAtLocation(2, 2, 7);

            square.GetNumberOfChanges().Should().Be(5);
        }