public UsersTests() { this.apiConfig = new FakeIOptions(); this.logger = new FakeLogger <UsersController>(); this.failingApiCalls = new FakeFailingApiCalls(); this.usersApiCalls = new FakeRoomsApiCalls(); }
public NotificationRepositoryTests() { this.logger = new FakeLogger <NotificationsController>(); this.apiConfig = new FakeIOptions(); this.apiCalls = new FakeNotificationsApiCalls(); this.failingApiCalls = new FakeFailingApiCalls(); }
public UsersRepository(IOptions <ApiConfig> apiConfig, ILogger <UsersController> logger, IApiCalls apiCalls) { _apiCalls = apiCalls; this.apiConfig = apiConfig.Value; _logger = logger; apiCall = new JObject(); }
public RoomRepository(IOptions <ApiConfig> apiConfig, ILogger <RoomsController> logger, IApiCalls apiCalls) { this.apiCalls = apiCalls; this.apiConfig = apiConfig.Value; this.logger = logger; rooms = GetAll(); }
public HomeCredentials(IOptions <ApiConfig> apiConfig, ILogger <HomeController> logger) { apiCalls = new ApiCalls(); this.apiConfig = apiConfig.Value; _logger = logger; apiCall = new JObject(); }
public RoomScheduleTests() { this.logger = new FakeLogger <ScheduleController>(); this.apiConfig = new FakeIOptions(); this.apiCalls = new FakeScheduleApiCalls(); this.failingApiCalls = new FakeFailingApiCalls(); }
private async Task <ActionResult <CommandLogDto> > UpdateDb(IApiCalls apiCalls) { DateTime lastUpdateTime = _repo.GetLatestLog().LastUpdate; if (DateTime.Now < lastUpdateTime.AddHours(1)) { return(NoContent()); } _repo.ClearListings(); IEnumerable <Listing> listingsToAdd = await apiCalls.GetAllListings(); _repo.AddListings(listingsToAdd); CommandLog commandLog = new CommandLog(); commandLog.Deleted = (_repo.GetRecipePricesCount() + _repo.GetTpPricesCount()); commandLog.CommandExecuted = "update"; commandLog.LastUpdate = DateTime.Now; commandLog.Inserted = _repo.GetListingsCount(); _repo.AddCommandLog(commandLog); SetAllRecipesCreationPrice(); if (_repo.SaveChanges()) { //return NotFound(); CommandLogDto commandLogDto = _mapper.Map <CommandLogDto>(commandLog); //TODO: change to add rout in response header return(Ok(commandLogDto)); } return(NotFound()); }
public RoomRepositoryTests() { this.apiConfig = new FakeIOptions(); this.logger = new FakeLogger <RoomsController>(); this.failingApiCalls = new FakeFailingApiCalls(); this.roomsApiCalls = new FakeRoomsApiCalls(); }
public KeyValueItem(IApiCalls <Brand> brandApiCalls, IApiCalls <Model> modelApiCalls, IApiCalls <Fuel> fuelApiCalls, IApiCalls <TransmisionType> transmisionApiCalls, IApiCalls <Location> locationApiCalls) { _brandApiCalls = brandApiCalls; _modelApiCalls = modelApiCalls; _fuelApiCalls = fuelApiCalls; _transmissionApiCalls = transmisionApiCalls; _locationApiCalls = locationApiCalls; }
public NotificationRepository(IApiCalls apiCalls, IOptions <ApiConfig> apiConfig, ILogger <NotificationsController> logger) { this.apiCalls = apiCalls; this.apiConfig = apiConfig.Value; this.logger = logger; }
public RoomSchedule(IOptions <ApiConfig> apiConfig, ILogger <ScheduleController> logger, IApiCalls apiCalls) { this.apiCalls = apiCalls; this.apiConfig = apiConfig.Value; this.logger = logger; }
public LocationController(IApiCalls <Location> apiCall) { _locationApiCall = apiCall; }
public UICarController(IApiCalls <Car> apiGetCalls, UserManager <IdentityUser> userManager, IKeyValueItem keyValueItem) { _carApiGetCall = apiGetCalls; _userManager = userManager; _keyValueItem = keyValueItem; }
public BookingController(IApiCalls <Booking> apiCalls, IApiCalls <Location> locationApiCall) { _bookingApiCalls = apiCalls; _locationApiCall = locationApiCall; }
public async Task <ActionResult <CommandLogDto> > PostExeuteCommand(ExecuteCommandReadDto commandDto, [FromServices] IApiCalls apiCalls) { ExecuteCommand command = _mapper.Map <ExecuteCommandReadDto, ExecuteCommand>(commandDto); if (command == null) { return(BadRequest()); } switch (command.Command) { case "update": return(await UpdateDb(apiCalls)); default: return(BadRequest()); } }
public FuelController(IApiCalls <Fuel> apiGetCalls) { _apiGetCalls = apiGetCalls; }
public BrandController(IApiCalls <Brand> brandApiCall, IApiCalls <Model> modelApiCalls) { this._brandApiCall = brandApiCall; this._modelApiCall = modelApiCalls; }
public AspNetUsersController(IApiCalls <AspNetUsers> apiCalls) { this._apiCalls = apiCalls; }