static void Main(string[] args) { //List<int> lista = new List<int>(); //CreateCarCmd carCmd = new CreateCarCmd(); //carCmd.Execute(); //CreatePartCmd cmd = new CreatePartCmd(); //cmd.Execute(new BL.Part.DTO.PartDTO() { Name = "wahacz"}); var carGarageContext = new CarHistoryContext(); GetAllCarQuery query = new GetAllCarQuery(carGarageContext); List <BL.Car.DTO.CarDTO> cars = query.Execute(); var index = 0; Console.WriteLine(cars.Count.ToString()); foreach (var car in cars) { Console.WriteLine(car.Name + "index= " + index); if (index == 2) { continue; } index++; } Console.ReadKey(); }
public void Read_All_Cars() { var carContextMock = new Mock <DB.Interface.IDatabaseService>(); carContextMock.Setup(x => x.Cars).Returns(carsMock.Object); var allCarsQuery = new GetAllCarQuery(carContextMock.Object); var allCars = allCarsQuery.Execute(); Assert.IsTrue(allCars.Count > 0); }