コード例 #1
0
        public void Concat_ThrowsOverflowException_WhenPassingLongString()
        {
            //Arrage
            var          stringConcatenator  = new StringConcatenator();
            const string OVER_MAXIMUM_LENGTH = "ala ma kota i psa";

            //Act
            Action action = () => stringConcatenator.Concat(OVER_MAXIMUM_LENGTH);

            //Assert
            Assert.Throws <OverflowException>(action);
        }
コード例 #2
0
        public void Concat_RestursExpected_WhenPassingStrings(string input, string expected)
        {
            //Arrage
            var stringConcatenator = new StringConcatenator();

            //Act
            stringConcatenator.Concat(input);
            var result = stringConcatenator.ToString();

            //Assert
            Assert.Equal(expected, result);
        }
コード例 #3
0
        public void Concat_ResultsSameStringAsInput_WhenPassingSingleSign()
        {
            //Arrage
            //var stringConcatenator = new StringConcatenator();
            var value = string.Concat(new Faker().Random.Chars(count: 1));


            //Act
            _stringConcatenator.Concat(value);
            var result = _stringConcatenator.ToString();

            //Assert
            Assert.Equal(value, result);
        }