public DeleteCustomerHandlerTest(QueryTestFixture fixture) { _unitOfWork = fixture.UnitOfWork; _bus = fixture.Bus; _notifications = fixture.Notifications; _validator = new DeleteCustomerCommandValidator(); }
public void ItShouldDeleteIfExistingCustomer() { var customer = new Customer { CustomerId = 1 }; var readStore = new Mock <ICustomerRepository>(); readStore.Setup(_ => _.GetCustomerById(It.IsAny <int>())).ReturnsAsync(customer); var sut = new DeleteCustomerCommandValidator(readStore.Object); var result = sut.Validate(new DeleteCustomerCommand { Id = 1 }); result.IsValid.ShouldBe(true); }