public async Task Handle_ShouldGetPartner() { // Arrange var id = ObjectId.GenerateNewId().ToString(); var command = new GetPartnerByIdQuery(id); _repository.Get(id).Returns(default(Partner)); // Act var response = await _handler.Handle(command, default(CancellationToken)); // Assert await _repository.Received(1).Get(id); }
public async Task Handle_ShouldCreatePartner() { // Arrange var command = new CreatePartnerCommand() { Address = new Geolocalization.Application.Command.Commands.Point(), CoverageArea = new Geolocalization.Application.Command.Commands.MultiPolygon() }; var generatedId = ObjectId.GenerateNewId().ToString(); _repository.Create(Arg.Any <Partner>()).Returns(generatedId); // Act var response = await _handler.Handle(command, default(CancellationToken)); // Assert await _repository.Received(1).Create(Arg.Any <Partner>()); }