public async Task <ActionResult <Domain.Models.Car> > Get(string regNo) { var query = new CarByRegNo(regNo); var car = await query.Execute(_dbSource); return(Ok(car)); }
public async Task ShouldReturnNotNull() { var dbDataAccess = Substitute.For <IDbDataAccess>(); dbDataAccess .Query(Arg.Any <Expression <Func <DataAccess.Entities.Car, bool> > >(), Arg.Any <Expression <Func <DataAccess.Entities.Car, Domain.Models.Car> > >()) .Returns(new[] { new Domain.Models.Car("GLW975", "Volvo", "V60", 2016) }); var sut = new CarByRegNo("GLW975"); var car = await sut.Execute(dbDataAccess); car.Should().NotBeNull(); }