/// <summary> /// Storage для автомобилей /// </summary> public AutomobileStorage( IAutomobileRepository automobileRepository, IDistributedCache distributedCache ) { _automobileRepository = automobileRepository; _distributedCache = distributedCache; }
public void Setup() { _automobileTypes = new List <AutomobileTypes> { new AutomobileTypes { type = "Truck", wheels = 4 }, new AutomobileTypes { type = "Car", wheels = 4 }, new AutomobileTypes { type = "Motorbike", wheels = 2 } }.AsQueryable(); _automobiles = new List <Automobiles> { new Automobiles { AutomobileId = 1 } }.AsQueryable(); _mikeDBContext = new Mock <MikeDBContext>(); _mockAutmobile = new Mock <DbSet <Automobiles> >(); _mockTypes = new Mock <DbSet <AutomobileTypes> >(); _mockTypes.As <IQueryable <AutomobileTypes> >().Setup(c => c.Provider).Returns(_automobileTypes.Provider); _mockTypes.As <IQueryable <AutomobileTypes> >().Setup(c => c.Expression).Returns(_automobileTypes.Expression); _mockTypes.As <IQueryable <AutomobileTypes> >().Setup(c => c.ElementType).Returns(_automobileTypes.ElementType); _mockTypes.As <IQueryable <AutomobileTypes> >().Setup(c => c.GetEnumerator()).Returns(_automobileTypes.GetEnumerator()); _mockAutmobile.As <IQueryable <Automobiles> >().Setup(c => c.Provider).Returns(_automobiles.Provider); _mockAutmobile.As <IQueryable <Automobiles> >().Setup(c => c.Expression).Returns(_automobiles.Expression); _mockAutmobile.As <IQueryable <Automobiles> >().Setup(c => c.ElementType).Returns(_automobiles.ElementType); _mockAutmobile.As <IQueryable <Automobiles> >().Setup(c => c.GetEnumerator()).Returns(_automobiles.GetEnumerator()); _mikeDBContext.Setup(c => c.AutomobileTypes) .Returns(_mockTypes.Object); _mikeDBContext.Setup(c => c.Automobiles) .Returns(_mockAutmobile.Object); _automobileRepo = new AutomobileRepository(_mikeDBContext.Object); _webDriver = new ChromeDriver("D:\\ChromeDriver2\\"); }
public AutomobileManager() { _autoRepo = new AutomobileRepository (); }
public AutomobileManager() { _autoRepo = new AutomobileRepository(); }
public AutomobileService(IAutomobileRepository theAutoRepository, ILocationRepository theLocationRepository) { _autoRepository = theAutoRepository; _locationRepository = theLocationRepository; }