public PotterServiceTests() { var _mockConfSection = new Mock<IConfigurationSection>(); _mockConfSection.SetupGet(m => m[It.Is<string>(s => s == "PotterUrl")]).Returns("https://www.potterapi.com/v1/"); _mockConfSection.SetupGet(m => m[It.Is<string>(s => s == "PotterKey")]).Returns("$2a$10$Gv2j7QtT7dO0CuIEaVOfcuVemz2W7.daT96/u/VojjXoNnWSYERGS"); var mockConfiguration = new Mock<IConfiguration>(); mockConfiguration.Setup(a => a.GetSection(It.Is<string>(s => s == "AppSettings"))).Returns(_mockConfSection.Object); var mockLogger = new Mock<ILogger<PotterService>>(); _service = new PotterService(mockConfiguration.Object, mockLogger.Object); }
public CharacterHandler(ICharacterRepository characterRepository, IPotterService potterService) { _characterRepository = characterRepository; _potterService = potterService; }