public void ShouldGenerateDuplicateLabelWithSuffixForSubsequentDuplicateFileContent() { FileLabeller labeller = new FileLabeller(new TestFileReader("001")); string firstLabel = labeller.Generate(InitialIntegrationResult()); string secondLabel = labeller.Generate(SuccessfulResult(firstLabel)); Assert.AreEqual("001", secondLabel); }
public void ShouldGenerateLabelWithSuffixForSubsequentDuplicateFileContent() { FileLabeller labeller = new FileLabeller(new TestFileReader("001")); labeller.AllowDuplicateSubsequentLabels = false; string firstLabel = labeller.Generate(InitialIntegrationResult()); IntegrationResult integrationResult = SuccessfulResult(firstLabel); string secondLabel = labeller.Generate(integrationResult); Assert.AreEqual("001-1", secondLabel); IntegrationResult integrationResult2 = SuccessfulResult(secondLabel); string thirdLabel = labeller.Generate(integrationResult2); Assert.AreEqual("001-2", thirdLabel); }
public void ShouldReplaceWhitespaceWithBlanks() { FileLabeller labeller = new FileLabeller(new TestFileReader("001 \r\n\t 002 \t\r\n 003")); string label = labeller.Generate(InitialIntegrationResult()); Assert.AreEqual("001 002 003", label); }
public void ShouldIgnoreLeadingAndTrailingWhitespaceInFile() { FileLabeller labeller = new FileLabeller(new TestFileReader("\r\n\t 001 \t\r\n")); string label = labeller.Generate(InitialIntegrationResult()); Assert.AreEqual("001", label); }
public void ShouldGenerateFirstLabel() { FileLabeller labeller = new FileLabeller(new TestFileReader("001")); labeller.AllowDuplicateSubsequentLabels = false; string label = labeller.Generate(InitialIntegrationResult()); Assert.AreEqual("001", label); }
public void ShouldGenerateLabelWithPrefix() { FileLabeller labeller = new FileLabeller(new TestFileReader("001")); labeller.Prefix = "V0-"; string label = labeller.Generate(InitialIntegrationResult()); Assert.AreEqual("V0-001", label); }