Esempio n. 1
0
        private ModulusCheckingMethod ToModulusCheckingMethod(ModulusMethod sourceMethod)
        {
            switch (sourceMethod)
            {
            case ModulusMethod.MOD10:
                return(ModulusCheckingMethod.StandardTen);

            case ModulusMethod.MOD11:
                return(ModulusCheckingMethod.StandardEleven);

            case ModulusMethod.DBLAL:
                return(ModulusCheckingMethod.AlternateDouble);

            default:
                return(ModulusCheckingMethod.None);
            }
        }
Esempio n. 2
0
        public void Create_PassFullyPopulatedWeightingsDto_ReturnsObjectWithExpectedValues(string expectedFromSortCode, string expectedToSortCode, ModulusMethod sourceMethod, ModulusCheckingMethod expectedMethod)
        {
            // Arrange
            var modulusWeightingFactory = new ModulusWeightingFactory();
            var weightingDto            = new WeightingDto()
            {
                SortCodeFrom    = expectedFromSortCode,
                SortCodeTo      = expectedToSortCode,
                Method          = sourceMethod,
                WeightingValues = new List <WeightingValue>()
            };

            // Act
            var weightingDetails = modulusWeightingFactory.Create(weightingDto);

            // Assert
            Assert.AreEqual(expectedFromSortCode, weightingDetails.FromSortCode);
            Assert.AreEqual(expectedToSortCode, weightingDetails.ToSortCode);
            Assert.AreEqual(expectedMethod, weightingDetails.CheckingMethod);
        }