Beispiel #1
0
        public void T04_ExpandTo_NegativeTargetLength_ThrowsException()
        {
            string inputText    = "Anyway";
            int    targetLength = -1;

            Assert.Throws <ArgumentOutOfRangeException>(() => StringLib.ExpandTo(inputText, targetLength));
        }
Beispiel #2
0
        public void T09_ExpandTo_StringIs2Char2AndTargetLengthIs3_CorrectResult()
        {
            string inputText      = "AB";
            int    targetLength   = 3;
            string expectedOutput = "ABA";

            string actualOutput = StringLib.ExpandTo(inputText, targetLength);

            Assert.AreEqual(expectedOutput, actualOutput);
        }
Beispiel #3
0
        public void T05_ExpandTo_ZeroTargetLength_ReturnsEmptyString()
        {
            string inputText      = "Anything";
            int    targetLength   = 0;
            string expectedOutput = String.Empty;

            string actualOutput = StringLib.ExpandTo(inputText, targetLength);

            Assert.AreEqual(expectedOutput, actualOutput);
        }
Beispiel #4
0
        public void T03_ExpandTo_InputIsOneSpace_ThrowsException()
        {
            string inputText = " ";

            Assert.Throws <ArgumentException>(() => StringLib.ExpandTo(inputText, 20));
        }
Beispiel #5
0
        public void T02_ExpandTo_EmptyString_ThrowsException()
        {
            string inputText = "";

            Assert.Throws <ArgumentException>(() => StringLib.ExpandTo(inputText, 20));
        }
Beispiel #6
0
        public void T01_ExpandTo_NullArgument_ThrowsException()
        {
            string inputText = null;

            Assert.Throws <ArgumentNullException>(() => StringLib.ExpandTo(inputText, 20));
        }