public async Task ReturnsUnitWhenCarNotFound() { var dbContext = DbContextFactory.CreateInMemory(); var handler = new DeleteCarCommandHandler(dbContext); var result = await handler.Handle(generator.DeleteCommand, default); Assert.StrictEqual(MediatR.Unit.Value, result); }
public async Task ReturnsUnitWhenCarFound() { var dbContext = DbContextFactory.CreateInMemory(); var entity = generator.Entity; dbContext.Cars.Add(entity); await dbContext.SaveChangesAsync(); var handler = new DeleteCarCommandHandler(dbContext); var result = await handler.Handle(new DeleteCarCommand { Id = entity.PublicId }, default); Assert.StrictEqual(MediatR.Unit.Value, result); }