コード例 #1
0
 public void Should_returnValidationException_Address()
 {
     var(_, exception) = new ModifyUserAddress(UserFakeMother.BuildUserWithAddress()).UpdateUserAddress(null);
     Assert.NotNull(exception);
     Assert.IsTrue(exception is ValidationException);
     Assert.AreEqual(new ValidationException("address").Message, exception.Message);
 }
コード例 #2
0
 public User GetById(int userId)
 {
     if (userId == default)
     {
         return(null);
     }
     return(UserFakeMother.BuildUserWithAddress(userId));
 }
コード例 #3
0
        public void Should_returnUser_with_address_modified()
        {
            var originalUser = UserFakeMother.BuildUserWithAddress();
            var newAddress   = AddressFakeMother.OkAddress();

            var(updatedUser, exception) = new ModifyUserAddress(originalUser).UpdateUserAddress(newAddress);
            Assert.NotNull(updatedUser);
            Assert.Null(exception);

            Assert.AreEqual(updatedUser.PrimaryAddress, newAddress);
        }