コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #5
0
        public void ShouldGenerateFirstLabel()
        {
            FileLabeller labeller = new FileLabeller(new TestFileReader("001"));

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

            Assert.AreEqual("001", label);
        }
コード例 #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);
        }