public PokemonController(ILogger <PokemonController> logger, IPokemonService pokemonRepo, IShakespeareTranslationService translationService) { _logger = logger; _pokemonRepo = pokemonRepo; _translationService = translationService; }
public MainViewModel(ICustomVision customVision, IPokemonService pokemonService) : base("Pokédex") { VerificarPokemonCommand = new Command(ExecuteVerificarPokemonCommand); _CustomVision = customVision; _PokemonService = pokemonService; }
public AbilityViewModel(INavigationService navigationService, IPokemonService pokemonService, IStaticDataService staticDataService) : base(staticDataService) { _tokenSource = new CancellationTokenSource(); _navigationService = navigationService; _pokemonService = pokemonService; _cachedAbilityId = 1; }
public async void Valid_PokemonName_ReturnSuccess() { //Arrange _mockClient.Setup(x => x.Get(It.IsAny <string>(), It.IsAny <PokemonQueryParams>())).ReturnsAsync(new PokemonSpecies { Name = TestData._mockName, FlavorTextEntries = new List <PokemonSpeciesFlavorTexts> { new PokemonSpeciesFlavorTexts { FlavorText = TestData._mockDetails, Language = new NamedApiResource <Language> { Name = "en" } } } }); _pokemonService = new PokemonService(_mockLogger.Object, _mockClient.Object, _mockOptions.Object); //Act var output = await _pokemonService.GetPokemonDetailsAsync(TestData._mockName); //Assert Assert.Equal(TestData._mockName, output.Name); Assert.Equal(TestData._mockDetails, output.Description); Assert.Null(output.Error); }
public MainViewModel() { Pokemons = new ObservableCollection <Pokemon>(); _pokemonService = new PokemonService(); // Aqui deveria ter uma Injeção de Dependencia LoadAsync(); }
public PokemonApi (IPokemonService pokemonService, ILogger <PokemonApi> logger) { _pokemonService = pokemonService; _logger = logger; }
public PokemonModule(ISpawnpointRepository spawnpointRepository, ISightingRepository sightingRepository, IPokemonService pokemonService, IConfigurationService configurationService, IEmojiService emojiService, ILocalizationService localizationService) : base(configurationService, emojiService, localizationService) { SpawnpointRepository = spawnpointRepository; SightingRepository = sightingRepository; _pokemonService = pokemonService; }
public CatchService(IPokemonService pokemonService, IMapper mapper, IRepository <Pokemon> pokeRepository, IChanceGenerator chanceGenerator) { _pokemonService = pokemonService; _mapper = mapper; _pokeRepository = pokeRepository; _chanceGenerator = chanceGenerator; }
public ScenarioPokemonService(ModInfo mod, IPokemonService pokemonService) : base(null, 0, 10) { for (int i = _minId; i <= _maxId; i++) { _cache.Add(new ChildScenarioPokemonService(Path.Combine(mod.FolderPath, Constants.ScenarioPokemonPathFromId(i)), pokemonService)); } }
public VMDetailPokemon(IMvxNavigationService navigationService, IPokemonService pokemonService, IRestClient restClient) { _navigationService = navigationService; _pokemonService = pokemonService; _restClient = restClient; PokemonsTypes = new MvxObservableCollection <PokemonGeneration>(); }
public override void OnActionExecuting(ActionExecutingContext context) { _pokemonService = context.HttpContext.RequestServices.GetService <IPokemonService>(); if (context.ActionArguments.Values.FirstOrDefault() is PokemonForCreationDto) { var dto = new PokemonForCreationDto(); dto = context.ActionArguments.Values.Cast <PokemonForCreationDto>().FirstOrDefault(); if (dto != null) { if (string.IsNullOrEmpty(dto.ImageUrl)) { context.ModelState.AddModelError(nameof(dto.ImageUrl), "Image is required."); } if (!_pokemonService.NameIsUnique(dto.Name)) { context.ModelState.AddModelError(nameof(dto.Name), "Name is not unique."); } } } if (!context.ModelState.IsValid) { context.Result = new ValidationFailedResult(context.ModelState); } }
public PokemonController(ILogger <PokemonController> logger, IPokemonService serviceTypes) { _pokemonService = serviceTypes; _logger = logger; _logger.LogInformation("ctor"); }
public MainViewModel() { Pokemons = new ObservableCollection <Pokemon>(); _pokemonService = new PokemonService(); RefreshCommand = new Command(RefreshExecute); LoadAsync(); }
public RaidService(IRaidRepository raidRepository, IGymService gymService, IPokemonService pokemonService, IRaidbossService raidbossService, ILocalizationService localizationService) { RaidRepository = raidRepository; LocalizationService = localizationService; GymService = gymService; PokemonService = pokemonService; RaidbossService = raidbossService; }
public PokemonController(IPokemonService pokemonService, IMapper <Pokemon, PokemonDto> pokemonMapper, ITranslationService translationService, IMapper <Pokemon, TranslatedPokemonDto> translatedPokemonMapper) { _pokemonService = pokemonService; _pokemonMapper = pokemonMapper; _translationService = translationService; _translatedPokemonMapper = translatedPokemonMapper; }
public OcrService(IConfigurationService configurationService, IGymService gymService, IPokemonService pokemonService, IRaidService raidService, ILocalizationService localizationService) { ConfigurationService = configurationService; GymService = gymService; PokemonService = pokemonService; RaidService = raidService; LocalizationService = localizationService; }
public ScenarioWarriorGridViewModel(IIdToNameService idToNameService, IScenarioPokemonService scenarioPokemonService, IPokemonService pokemonService, IAbilityService abilityService) { _scenarioPokemonService = scenarioPokemonService; _pokemonService = pokemonService; _abilityService = abilityService; WarriorItems = idToNameService.GetComboBoxItemsExceptDefault <IBaseWarriorService>(); KingdomItems = idToNameService.GetComboBoxItemsPlusDefault <IKingdomService>(); }
public ListagemPokemonsPageViewModel(IPokemonService pokemonService, INavigationService navigationService, IPageDialogService pageDialogService) { _pokemonService = pokemonService; _navigationService = navigationService; _pageDialogService = pageDialogService; Pokemons = _pokemonService.SelectAll(); }
public VMFilterTypePokemon(IMvxNavigationService navigationService, IPokemonService pokemonService, IRestClient restClient) { _navigationService = navigationService; _pokemonService = pokemonService; _restClient = restClient; ClosePageCommand = new MvxAsyncCommand(ClosePage); PokemonsTypes = new MvxObservableCollection <PokemonGeneration>(); PokemonTypeSelectedCommand = new MvxAsyncCommand <PokemonGeneration>(PokemonTypeSelected); }
public MainViewModel(ILogger <MainViewModel> logger) { IsNotConnected = false; Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged; Title = "Poke Xamarin"; Pokemons = new ObservableCollection <Pokemon>(); _PokemonService = App.ServiceProvider.GetService <IPokemonService>(); logger.LogCritical("Acessando o Aplicativo"); }
public PokemonApiTests() { _mockRepository = new MockRepository(MockBehavior.Strict); _dataProvider = _mockRepository.Create <IDataProvider>(); _mapper = _mockRepository.Create <IMapper>(); _logger = new Mock <ILogger <PokemonService> >(); _subject = new PokemonService(_dataProvider.Object, _logger.Object, _mapper.Object); }
/// <summary> /// Load all the required stuff into memory /// </summary> private void Init(IServiceGetter services) { _moveService = services.Get <IMoveService>(); _moveRangeService = services.Get <IMoveRangeService>(); _pokemonService = services.Get <IPokemonService>(); _scenarioPokemonService = services.Get <IScenarioPokemonService>(); _scenarioWarriorService = services.Get <IScenarioWarriorService>(); _moveRangeService = services.Get <IMoveRangeService>(); }
public QuizFlow (IHttpContextAccessor httpContextAccessor, IRandomizer randomizer, IPokemonService pokemonService, IQuizCalculations quizCalculations) { _session = httpContextAccessor.HttpContext.Session; _randomizer = randomizer; _pokemonService = pokemonService; _quizCalculations = quizCalculations; }
public QuizController (IPokemonService pokemonService, IRandomizer randomizer, IHttpContextAccessor httpContextAccessor, IQuizCalculations quizCalculations, IQuizFlow quizFlow, IPokemonUserSQLService pokemonUserSQLService) { _pokemonService = pokemonService; _randomizer = randomizer; _session = httpContextAccessor.HttpContext.Session; _quizCalulations = quizCalculations; _quizFlow = quizFlow; _pokemonUserSQLService = pokemonUserSQLService; }
public async void Valid_PokemonName_ReturnsErrorNullSpecies() { //Arrange _mockClient.Setup(x => x.Get(It.IsAny <string>(), It.IsAny <PokemonQueryParams>())).ReturnsAsync(new PokemonSpecies { Name = TestData._mockName, FlavorTextEntries = null }); _pokemonService = new PokemonService(_mockLogger.Object, _mockClient.Object, _mockOptions.Object); //Act var output = await _pokemonService.GetPokemonDetailsAsync(TestData._mockName); //Assert Assert.NotNull(output.Error); Assert.Equal(500, output.Error.Code); }
public MapPageViewModel(INavigationService navigationService, IPokemonService pokemonService) : base(navigationService) { Title = "Mapa de Pokemons"; _pokemonService = pokemonService; _navigationService = navigationService; Map = new CustomMap(); CustomMap = new CustomMap { MapType = MapType.Street, WidthRequest = App.ScreenWidth, HeightRequest = App.ScreenHeight }; //var pins = new List<CustomPin>(); _pokemon = new Poke(); }
public PokemonViewModel(IStaticDataService staticDataService, IPokemonService pokemonService, INavigationService navigationService) { _tokenSource = new CancellationTokenSource(); _staticDataService = staticDataService; _pokemonService = pokemonService; _navigationService = navigationService; var settings = ApplicationData.Current.LocalSettings; object lang = settings.Values["displayLanguage"]; if (lang != null) { _currentLanguage = Convert.ToInt32(lang); } else { _currentLanguage = 6; } ChangeLanguage(new Language { Id = _currentLanguage }); Messenger.Default.Register <Language>(this, (language) => ChangeLanguage(language)); if (IsInDesignMode) { Versions = NotifyTaskCompletionCollection <GameVersion> .Create(LoadVersionsAsync(_currentLanguage)); SpeciesList = NotifyTaskCompletionCollection <SpeciesName> .Create(LoadSpeciesAsync(null, _currentLanguage)); Forms = NotifyTaskCompletionCollection <PokemonForm> .Create(LoadFormsAsync(new SpeciesName { Id = 1 }, null, _currentLanguage)); CurrentForm = NotifyTaskCompletion.Create(LoadFormAsync(1, null, _currentLanguage)); CurrentMoveSet = NotifyTaskCompletion.Create(LoadMoveSetAsync(6, null, _currentLanguage)); CurrentStats = NotifyTaskCompletion.Create(LoadStatsAsync(6, null, _currentLanguage)); CurrentEvolutions = NotifyTaskCompletion.Create(LoadEvolutionsAsync(6, null, _currentLanguage)); CurrentLocations = NotifyTaskCompletion.Create(LoadLocationsAsync(6, null, _currentLanguage)); } }
public VMTypePokemon(IMvxNavigationService navigationService, IPokemonService pokemonService, IRestClient restClient) { _navigationService = navigationService; _pokemonService = pokemonService; _restClient = restClient; FilterTypeCommand = new MvxCommand(FilterPokemon); AllFilterTypeCommand = new MvxCommand(AllPokemmon); Pokemons = new MvxObservableCollection <PokemonGeneration>(); PokemonSelectedCommand = new MvxAsyncCommand <PokemonGeneration>(PokemonSelected); FetchPokemonCommand = new MvxCommand( () => { if (!string.IsNullOrEmpty(_nextPage)) { FetchPokemonTask = MvxNotifyTask.Create(LoadPokemon); RaisePropertyChanged(() => FetchPokemonTask); } }); RefreshPokemonCommand = new MvxCommand(RefreshPokemon); _IsVisibleAllPokemon = true; }
public PokedexController(IPokemonService pokemonService, IQuizFlow quizFlow) { _pokemonService = pokemonService; _quizFlow = quizFlow; }
public BattleService(IPokemonService pokemonService, ILogger <BattleService> logger) { _pokemonService = pokemonService; _logger = logger; }
public PokemonController(IPokemonService service) { _service = service; }
public PokemonViewModel(IStaticDataService staticDataService, IPokemonService pokemonService, INavigationService navigationService) { _tokenSource = new CancellationTokenSource(); _staticDataService = staticDataService; _pokemonService = pokemonService; _navigationService = navigationService; var settings = ApplicationData.Current.LocalSettings; object lang = settings.Values["displayLanguage"]; if (lang != null) _currentLanguage = Convert.ToInt32(lang); else _currentLanguage = 6; ChangeLanguage(new Language { Id = _currentLanguage }); Messenger.Default.Register<Language>(this, (language) => ChangeLanguage(language)); if (IsInDesignMode) { Versions = NotifyTaskCompletionCollection<GameVersion>.Create(LoadVersionsAsync(_currentLanguage)); SpeciesList = NotifyTaskCompletionCollection<SpeciesName>.Create(LoadSpeciesAsync(null, _currentLanguage)); Forms = NotifyTaskCompletionCollection<PokemonForm>.Create(LoadFormsAsync(new SpeciesName { Id = 1 }, null, _currentLanguage)); CurrentForm = NotifyTaskCompletion.Create(LoadFormAsync(1, null, _currentLanguage)); CurrentMoveSet = NotifyTaskCompletion.Create(LoadMoveSetAsync(6, null, _currentLanguage)); CurrentStats = NotifyTaskCompletion.Create(LoadStatsAsync(6, null, _currentLanguage)); CurrentEvolutions = NotifyTaskCompletion.Create(LoadEvolutionsAsync(6, null, _currentLanguage)); CurrentLocations = NotifyTaskCompletion.Create(LoadLocationsAsync(6, null, _currentLanguage)); } }