コード例 #1
0
        public void HasPendingKudos_Should_Return_True()
        {
            MockKudosLogsForStats();
            var actual = _kudosService.HasPendingKudos("User1");

            Assert.AreEqual(true, actual);
        }
コード例 #2
0
        public IHttpActionResult DeleteUser(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(BadRequest());
            }

            bool canNotBeDeleted = _kudosService.HasPendingKudos(id);

            if (canNotBeDeleted)
            {
                return(Content(HttpStatusCode.MethodNotAllowed, "Employee has pending kudos"));
            }

            _userService.Delete(id, GetUserAndOrganization());
            return(Ok());
        }