示例#1
0
        public void TruncateAtWordShouldReturnTheSameInputWhenItsLengthIsShorterThanTheTruncateLength()
        {
            var service = new StringService();
            var input   = "Test Input";

            Assert.Equal(input, service.TruncateAtWord(input, input.Length + 1));
        }
示例#2
0
        public void TruncateAtWordShouldReturnNullWithNullInput()
        {
            var service = new StringService();

            Assert.Null(service.TruncateAtWord(null, 30));
        }
示例#3
0
        public void TruncateAtWordShouldWorkCorrectly(string input, int length, string expected)
        {
            var service = new StringService();

            Assert.Equal(expected, service.TruncateAtWord(input, length));
        }