public void User_Extension_AsEntity_Null()
        {
            // Arrange
            UserDto user = null;

            // Act
            var result = user.AsEntity();

            // Assert
            Assert.IsNull(result);
            Assert.AreEqual(null, result);
        }
Пример #2
0
        public GenericServiceResponse <bool> DeleteUser(UserDto user)
        {
            return(TryExecute <GenericServiceResponse <bool> >((response) =>
            {
                response.Result = Repository.Delete(user.AsEntity());

                if (!response.Result)
                {
                    var errorMessage = "'DeleteUser' was unable to delete the given user record.";
                    response.Notifications.AddError(errorMessage);
                    Logger.Error(errorMessage);
                }
            }));
        }