public async Task CreateReseller_ValidData_Success() { // Arrange var command = new CreateResellerCommand { Name = "Fulano da silva", CPF = "84567632761", Email = "*****@*****.**", Password = "******" }; // Act await fixture.Instance.Send(command); // ßAssert fixture.ResellerRepositoryMock.Verify(m => m.CreateAsync(It.IsAny <Reseller>()), Times.Once()); }
public async Task <ActionResult <Reseller> > PostReseller(CreateResellerCommand command) { await mediator.Send(command); return(CreatedAtAction("GetReseller", new { id = "123" }, command)); }
public async Task CreateReseller_InvalidData_BusinessValidationException(CreateResellerCommand command) { // Assert await Assert.ThrowsAsync <BusinessValidationException>(async() => await fixture.Instance.Send(command)); }