示例#1
0
        public void AddressDtoIsValid_WhenMissingData_ShouldReturnFalse()
        {
            this.addressDto = new AddressDto();

            string msg = null;

            Assert.IsFalse(addressDto.IsValid(ref msg));
            Assert.AreEqual(msg, ErrorMessages.MissingStreetNumber);

            this.addressDto.StreetNumber = "StreeNumber";
            Assert.IsFalse(addressDto.IsValid(ref msg));
            Assert.AreEqual(msg, ErrorMessages.MissingCity);

            this.addressDto.City = "City";
            Assert.IsFalse(addressDto.IsValid(ref msg));
            Assert.AreEqual(msg, ErrorMessages.MissingState);

            this.addressDto.State = "State";
            Assert.IsFalse(addressDto.IsValid(ref msg));
            Assert.AreEqual(msg, ErrorMessages.MissingZipCode);
        }
示例#2
0
        public void AddressDtoIsValid_WhenDataExists_ShouldReturnTrue()
        {
            this.addressDto = new AddressDto
            {
                StreetNumber = "StreetNumber",
                City         = "City",
                State        = "State",
                ZipCode      = "ZipCode"
            };

            string msg = null;

            Assert.IsTrue(addressDto.IsValid(ref msg));
        }