Ejemplo n.º 1
0
        public void CommaSeparatedSplitting_Works()
        {
            // arrange
            MockPartProcessor mockPartProcessor = new MockPartProcessor();
            string            toParse           = "Hello,World,!!!";

            Splitter sut = new Splitter(',');

            // act
            sut.ExtractParts(toParse, mockPartProcessor);

            // assert
            Assert.Equal(3, mockPartProcessor.Count);
        }
Ejemplo n.º 2
0
        public void CommaSeparatedSplitting_ReturnsTailEnd_Works()
        {
            // arrange
            MockPartProcessor mockPartProcessor = new MockPartProcessor();
            string            toParse           = "Hello,World,!!!";

            Splitter sut = new Splitter(',');

            // act
            ReadOnlySpan <char> tail = sut.ExtractParts(toParse, mockPartProcessor, true);

            // assert
            Assert.Equal(2, mockPartProcessor.Count);
            Assert.True(tail.SequenceEqual("!!!"));
        }