public void TestChangeStatusWebsiteAsync_WithNotValidParameters_ShouldThrowNotFoundException()
        {
            const int websiteId = 10;
            var       ex        = Assert.ThrowsAsync <NotFoundException>(() => websiteService.ChangeStatusAsync(websiteId, 1));

            Assert.AreEqual(string.Format(Constants.MessageResponse.NotFoundError, nameof(Website), websiteId.ToString()), ex.Message);
        }
예제 #2
0
        public async Task <IActionResult> ChangeStatus(int id, [FromBody] Status status)
        {
            await websiteService.ChangeStatusAsync(id, (int)status);

            return(Ok(new ApiResponse <WebsiteModel>()));
        }