Пример #1
0
        public void GetBrokenRulesValidInputTest()
        {
            var address = new Domain.Address.Address {
                Country     = "UK",
                City        = "London",
                Street      = "Baker street",
                HouseNumber = "221B"
            };

            var spec   = new AddressCountryRequired();
            var broken = spec.GetBrokenRules(address);

            Assert.IsTrue(!broken.Any());
        }
Пример #2
0
        public void GetBrokenRulesMissingCountryTest()
        {
            var address = new Domain.Address.Address {
                Country     = null,
                City        = "London",
                Street      = "Baker street",
                HouseNumber = "221B"
            };

            var spec   = new AddressCountryRequired();
            var broken = spec.GetBrokenRules(address);

            Assert.IsTrue(broken.Any());
            Assert.AreEqual(1, broken.Count());
            Assert.AreEqual(AddressBusinessRules.AddressCountryRequired.Description, broken.First().Description);
        }