public async Task DeleteAsync_UnknownIdPassed_ThrowAnException() { // Arrange int departmentId = 11; _repositoryMock .Setup(rep => rep.GetByIdAsync(departmentId)) .ReturnsAsync(TestData.GetDepartmentById(departmentId)); // Act var exception = await Assert.ThrowsAsync <Exception>(() => _departmentService.DeleteAsync(departmentId)); // Assert Assert.NotNull(exception); }
private async Task HandleValidSubmit() { await _departmentService.DeleteAsync(DepartmentId); _navigationManager.NavigateTo("employee/employee-list"); }