Пример #1
0
        public void Test_non_acceptable_tests(string input)
        {
            var entityUnderTest = new ShortToLongAccountCode(input);

            entityUnderTest.IsCorrectCode.Should().BeFalse();
            entityUnderTest.LongCode.Should().BeNull();
        }
Пример #2
0
        private void SetUserInputCodeToLongFormat(Account account)
        {
            var shortToLongCode = new ShortToLongAccountCode(account.Code);

            if (!shortToLongCode.IsCorrectCode)
            {
                ModelState.AddModelError(nameof(Account.Code),
                                         "The code is in a wrong format. It must be supplied as up to 9 digits, with an optional dot (.) to separate first part from last part of the code.");
            }
            else
            {
                account.Code = shortToLongCode.LongCode;
            }
        }
Пример #3
0
        public string Test_normal_cases(string input)
        {
            var entityUnderTest = new ShortToLongAccountCode(input);

            return(entityUnderTest.LongCode);
        }