Beispiel #1
0
        public void ParseNext_WhenCompleteSegmentDataIsNull_ShouldNotProcessParagraphUnit()
        {
            // Arrange
            var testee = CreateTestee();

            testee.StartOfInput();

            A.CallTo(() => _segmendDataCollectorMock.CompleteSegmentData).Returns(null);

            // Act
            testee.ParseNext();

            // Assert
            A.CallTo(() => _paragraphUnitFactoryMock.Create(A <string> .Ignored, A <string> .Ignored, A <string> .Ignored, A <string> .Ignored)).MustNotHaveHappened();
            A.CallTo(() => _bilingualContentHandlerMock.ProcessParagraphUnit(A <IParagraphUnit> .Ignored)).MustNotHaveHappened();
        }
Beispiel #2
0
        public void ParseNext_WhenMultipleEntries_ShouldParseOneEntryAtATime()
        {
            // Arrange
            var testString = @"
msgid ""message id""
msgstr ""message string""
entryComplete
msgid ""message id""
msgstr ""message string""
entryComplete
msgid ""message id""
msgstr ""message string""
entryComplete
msgid ""message id""
msgstr ""message string""
entryComplete
";
            var testee     = CreateTestee(testString);

            testee.StartOfInput();

            // Act
            testee.ParseNext();
            testee.ParseNext();

            // Assert
            A.CallTo(() => _bilingualContentHandlerMock.ProcessParagraphUnit(A <IParagraphUnit> .Ignored))
            .MustHaveHappenedTwiceExactly();
        }