コード例 #1
0
        public void EnterLargeInputString_Passed()
        {
            //Arrange
            string inputString = "1111111111111111";
            BinaryToIntConvertor binaryToIntConvertor = new BinaryToIntConvertor();
            var ExpectedResult = "Integer: 65535";

            //Act
            var ActualResult = binaryToIntConvertor.Convert(inputString);

            //Assert

            Assert.AreEqual(ExpectedResult, ActualResult);
        }
コード例 #2
0
        public void EnterValidInputString_Passed_scenerio2()
        {
            //Arrange
            string inputString = "011";
            BinaryToIntConvertor binaryToIntConvertor = new BinaryToIntConvertor();
            var ExpectedResult = "Integer: 3";

            //Act
            var ActualResult = binaryToIntConvertor.Convert(inputString);

            //Assert

            Assert.AreEqual(ExpectedResult, ActualResult);
        }
コード例 #3
0
        public void EnterEmptyString_GetInvalidInputError()
        {
            //Arrange

            BinaryToIntConvertor binaryToIntConvertor = new BinaryToIntConvertor();
            var ExpectedResult = "Error: Invalid input: Entered string is empty, please enter valid binary string";

            //Act
            var ActualResult = binaryToIntConvertor.Convert("");

            //Assert

            Assert.AreEqual(ExpectedResult, ActualResult);
        }
コード例 #4
0
        public void EnterInvalidString_GetInvalidInputError()
        {
            //Arrange

            string inputString = "afdfgad";
            BinaryToIntConvertor binaryToIntConvertor = new BinaryToIntConvertor();
            var ExpectedResult = "Error: Invalid input: Entered string is not a binary string, please enter valid binary string";

            //Act
            var ActualResult = binaryToIntConvertor.Convert(inputString);

            //Assert

            Assert.AreEqual(ExpectedResult, ActualResult);
        }