Example #1
0
        public void Given_negative_width_and_height_When_Build_Then_throw_exception()
        {
            // Given
            var testClass = new GameField();

            // When
            // Then
            Assert.ThrowsException <Exception>(() => testClass.Build(-1, -1));
        }
Example #2
0
        public void Given_width_equal_height_When_Build_Then_return_100()
        {
            // Given
            var testClass = new GameField();

            // When
            var result = testClass.Build(2, 2);

            // Then
            Assert.AreEqual(100, result);
        }
Example #3
0
        public void Given_width_not_equal_height_When_Build_Then_return_multiplication()
        {
            // Given
            var testClass = new GameField();

            // When
            var result = testClass.Build(3, 2);

            // Then
            Assert.AreEqual(6, result);
        }
Example #4
0
        public void Given_negative_width_and_height_When_Build_Then_return_zero()
        {
            // Given
            const int x         = -1;
            var       c         = new List <string>();
            var       testClass = new GameField();

            // When
            var result = testClass.Build(x, -1);

            // Then
            Assert.AreEqual(0, result);
        }