Beispiel #1
0
        public void CheckStringInput_ContainsValueAboveAsciiValueOfZeroPlusBlockSize_ReturnsFalse()
        {
            // Testing a 4x4 board, which means that we expect that the value 5 will be out of range.

            // Arrange:
            InputOutput inputOutput = new InputOutput();
            string      input       = "5510200000304000";

            // Act:
            bool result = inputOutput.CheckStringInput(input);

            // Assert:
            Assert.IsFalse(result);
        }
Beispiel #2
0
        public void CheckStringInput_ContainsValueBelowAsciiValueOfZero_ReturnsFalse()
        {
            // The ascii value of . and / is below the ascii value of 0, which means
            // that we expect to get false out of this test.

            // Arrange:
            InputOutput inputOutput = new InputOutput();
            string      input       = "./10200000304000";

            // Act:
            bool result = inputOutput.CheckStringInput(input);

            // Assert:
            Assert.IsFalse(result);
        }
Beispiel #3
0
        public void CheckStringInputTest_StringIsValid_ReturnsTrue()
        {
            // Testing a valid input string case - only contains values in the ascii
            // range of values '0' -> '0' + BlockSize (including the edges).

            // Arrange:
            InputOutput inputOutput = new InputOutput();
            string      input       = "0010200000304000";

            // Act:
            bool result = inputOutput.CheckStringInput(input);

            // Assert:
            Assert.IsTrue(result);
        }