public FundaFacadeTests()
        {
            var client = new HttpClient();

            // Sorta ugly way to create configuration, doing it this way in the interest of time
            var configuration = new FundaConfiguration
            {
                ApiKey = Environment.GetEnvironmentVariable("Funda__ApiKey"),
            };

            var factoryMock = new Mock <IHttpClientFactory>();

            factoryMock.Setup(f => f.CreateClient(It.IsAny <string>())).Returns(client);

            var optionsMock = new Mock <IOptionsMonitor <FundaConfiguration> >();

            optionsMock.Setup(o => o.CurrentValue).Returns(configuration);

            _facade = new FundaFacade(factoryMock.Object, optionsMock.Object);
        }
Esempio n. 2
0
 public TopTenService(IFundaFacade fundaFacade)
 {
     _fundaFacade = fundaFacade;
 }