public void Setup() { service = new PokemonShakespeareService( new PokemonService(new PokemonClient()), new ShakespeareTranslator() ); }
public void Init() { var pokemonService = new Mock <IPokemonService>(); pokemonService.Setup(x => x.PokemonSpeciesAsync(Name)).ReturnsAsync(Species); pokemonService.Setup(x => x.PokemonSpeciesAsync(BadName)).Throws(new Exception(ExceptionMsg)); pokemonService.Setup(x => x.FlavorTextAsync(Species)).ReturnsAsync(Flavor); var translator = new Mock <ITranslator>(); translator.Setup(x => x.TranslateAsync(Flavor)).ReturnsAsync(Translation); service = new PokemonShakespeareService(pokemonService.Object, translator.Object); }
public PokemonController(IPokemonShakespeareService service, IMemoryCache memoryCache) { this.service = service; this.memoryCache = memoryCache; }