Exemple #1
0
        public void Given99772564_ReturnChecksum6()
        {
            var no        = @"99772564";
            var generator = new ChecksumGenerator();

            var result = generator.GenerateChecksum(no);

            result.Should().Be(6);
        }
Exemple #2
0
        public void Given91685876_ReturnChecksum0()
        {
            var no        = @"91685876";
            var generator = new ChecksumGenerator();

            var result = generator.GenerateChecksum(no);

            result.Should().Be(0);
        }
Exemple #3
0
        public void Given94357453_ReturnChecksum7()
        {
            var no        = @"94357453";
            var generator = new ChecksumGenerator();

            var result = generator.GenerateChecksum(no);

            result.Should().Be(7);
        }
Exemple #4
0
        public void Given991781544_ReturnEmptyString()
        {
            var completeOrgNum         = @"991781544";
            var orgNumWithouthChecksum = completeOrgNum.Substring(0, completeOrgNum.Length - 1);

            var generator = new ChecksumGenerator();
            var checksum  = generator.GenerateChecksum(orgNumWithouthChecksum);
            var result    = generator.ValidateChecksum(completeOrgNum, checksum);

            result.Should().Be("");
        }