コード例 #1
0
        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());
        }
コード例 #2
0
        public async Task <ActionResult <Reseller> > PostReseller(CreateResellerCommand command)
        {
            await mediator.Send(command);

            return(CreatedAtAction("GetReseller", new { id = "123" }, command));
        }
コード例 #3
0
 public async Task CreateReseller_InvalidData_BusinessValidationException(CreateResellerCommand command)
 {
     // Assert
     await Assert.ThrowsAsync <BusinessValidationException>(async() => await fixture.Instance.Send(command));
 }