コード例 #1
0
        public void SendToTwilio_ShouldReturnInvalid_WhenValidationFails(string enteredNum)
        {
            // arrange
            string expected = "Invalid phone number";

            var sut = new ValidateAndFormatPhone();

            // act
            string actual = sut.SendToTwilio(enteredNum);

            // assert
            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void SendToTwilio_ShouldReturnFormattedNum_WhenValid44DigitNumProvided()
        {
            // arrange
            string original = "+447540706000";
            string expected = "+447540706000";

            var sut = new ValidateAndFormatPhone();

            // act
            var actual = sut.SendToTwilio(original);

            // assert
            Assert.Equal(expected, actual);
        }
コード例 #3
0
        public void SendToTwilio_ShouldReturnFormattedNum_WhenLongerValidNumProvided()
        {
            // arrange
            string original = "00441616603202";
            string expected = "+441616603202";

            var sut = new ValidateAndFormatPhone();

            // act
            var actual = sut.SendToTwilio(original);

            // assert
            Assert.Equal(expected, actual);
        }