Exemplo n.º 1
0
        /// <summary>
        /// Updates user status
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="userStatus"></param>
        /// <param name="updatedByUserId"></param>
        /// <returns>Returns number of affected rows.</returns>
        public int Execute(Guid userId, UserStatusEnum userStatus, Guid updatedByUserId)
        {
            // in parameters
            var parameters = new List<SqlParameter>
            {
                DbHelper.CreateParameter(Parameters.UserId, userId),
                DbHelper.CreateParameter(Parameters.UserStatusCode, userStatus.GetCode()),
                DbHelper.CreateParameter(Parameters.UpdatedByUserId, updatedByUserId),
            };

            return DbHelper.ExecuteNonQueryCommand(this, parameters);
        }
Exemplo n.º 2
0
            public void ModifyUserStatusUpdatesStatus(UserStatusEnum userStatus)
            {
                // Arrange
                var userId = new Guid("00000000-0000-0000-0000-000000000001");

                // Act
                userExtensionDao.ModifyUserSatus(userId, userStatus);

                // Assert
                var updatedUserExtension = userExtensionDao.GetByKey(userId);
                Assert.AreEqual(userStatus.GetCode(), updatedUserExtension.UserStatusCode, "UserStatusCode has not been updated");
            }