示例#1
0
        public void LongLine_NotExist_Sym(string line, char sym)
        {
            // arrange
            var actual = 0;

            // act
            var expected = Parser.SymRepeats(line, sym);

            // assert
            Assert.Equal(expected, actual);
        }
示例#2
0
        public void SymRepeats_LongLine_GetCount(string line, char sym)
        {
            // arrange
            var actual = line.Where(l => l == sym).Count();

            // act
            var expected = Parser.SymRepeats(line, sym);

            // assert
            Assert.Equal(expected, actual);
        }
示例#3
0
        public void NullLine_throwArgumentException()
        {
            // arrange
            string line = null;

            // act and assert
            Assert.Throws <ArgumentException>(() =>
            {
                Parser.SymRepeats(line, default);
            });
        }
示例#4
0
        public void EmptyLine_throwArgumentException()
        {
            // arrange
            string line = string.Empty;

            // act and assert
            Assert.Throws <ArgumentException>(() =>
            {
                var result = Parser.SymRepeats(line, default);
            });
        }
示例#5
0
        public void OneSymbolLine_s_lenght()
        {
            // arrange
            var line   = "ssssssssss";
            var sym    = line[0];
            int actual = line.Length;
            // act
            var expected = Parser.SymRepeats(line, sym);

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