public async Task Success_CreateDepartement() { var command = new CreateDepartementCommand { Payload = new CreateDepartemenVM { Name = "Test success name", Location = "Test Success Location" } }; var result = await _mediator.Object.Send(command, default); Assert.IsType <SuccessResponse>(result); Assert.True(result.Success); }
public async Task Failed_CreateDepartement() { // Arrange await Success_CreateDepartement(); var command = new CreateDepartementCommand { Payload = new CreateDepartemenVM { Name = "Test Success Name", Location = "Test Success Location" } }; // Act var result = await _mediatr.Object.Send(command, default); // Assert Assert.IsType <SuccessResponse>(result); Assert.False(result.Success); }