Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        public void ShouldGenerateFirstLabel()
        {
            FileLabeller labeller = new FileLabeller(new TestFileReader("001"));

            labeller.AllowDuplicateSubsequentLabels = false;
            string label = labeller.Generate(InitialIntegrationResult());

            Assert.AreEqual("001", label);
        }
Ejemplo n.º 6
0
        public void ShouldGenerateLabelWithPrefix()
        {
            FileLabeller labeller = new FileLabeller(new TestFileReader("001"));

            labeller.Prefix = "V0-";
            string label = labeller.Generate(InitialIntegrationResult());

            Assert.AreEqual("V0-001", label);
        }