public async Task AddLogin()
        {
            // Arrange
            var request = "/api/timeSheet/logins/add";
            var model = new LogTimeViewModel()
            {
                UUId ="1",
                Time = "12:45 AM"
            };

            // Act
            var response = await _client.PostAsync(request, ContentHelper.GetStringContent(model));

            // Assert
            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }
예제 #2
0
        public async Task <IActionResult> AddLogout([FromBody] LogTimeViewModel model)
        {
            _logger.LogInformation($"/api/timeSheet/logouts/add");
            try
            {
                var time = DateTime.Parse(model.Time);
                await _repo.SaveUserLogoutAsync(model.UUId, time);

                return(Ok("true"));
            }
            catch (Exception ex)
            {
                _logger.LogError($"/api/timeSheet/logouts/add", ex);
                return(BadRequest());
            }
        }