public async Task When_Adding_Employee_Then_Sends_Command_Add_Employee_Handler(AddEmployeeCommandModel model)
        {
            // Act
            await sut.CreateEmployeesAsync(model);

            // Assert
            busMock.Verify(x => x.SendAsync(It.IsAny <AddEmployeeCommandModel>(), default), Times.Once);
        }
        public async Task When_Adding_Employee_With_Complete_Object_Then_Response_Accepted(AddEmployeeCommandModel model)
        {
            // Act
            var response = await sut.CreateEmployeesAsync(model);

            // Assert
            response.Should().BeOfType <AcceptedResult>();
        }
Esempio n. 3
0
        public async Task <IActionResult> CreateEmployeesAsync(AddEmployeeCommandModel model)
        {
            await bus.SendAsync(model);

            return(Accepted());
        }