public void GetVehicleByIdNotFoundTest() { var dummyData = _vehicleInStocks; var dummyId = 99999; context.VehiclesInStock = GetMockDbSet(dummyData).Object; var service = new VehicleInventoryService(context, Mapper); var dtoResult = service.GetVehicleInStockByIdFlat(dummyId); Assert.IsNull(dtoResult); }
public void GetVehiclesInStockByIdTest() { var dummyData = _vehicleInStocks; context.VehiclesInStock = GetMockDbSet(dummyData).Object; var service = new VehicleInventoryService(context, Mapper); var dtoResult = service.GetVehicleInStockByIdFlat(1); var data = dummyData.First(); var flatData = dtoResult; Assert.AreEqual(flatData.Make, data.Model.Make.Name); Assert.AreEqual(flatData.Model, data.Model.Name); Assert.AreEqual(flatData.Year, data.Model.Year); Assert.AreEqual(flatData.DateBought, data.DateBought); Assert.AreEqual(flatData.DateSold, data.DateSold); Assert.AreEqual(flatData.PriceSold, data.PriceSold); Assert.AreEqual(flatData.PriceBought, data.PriceBought); }