예제 #1
0
        public TemplateCommandMiddleware(TemplatesClient templatesClient, IOptions <TemplatesOptions> templateOptions, IUrlGenerator urlGenerator,
                                         ISemanticLog log)
        {
            this.templatesClient = templatesClient;
            this.templateOptions = templateOptions.Value;
            this.urlGenerator    = urlGenerator;

            this.log = log;
        }
예제 #2
0
        public TemplatesClientTests()
        {
            var httpClientFactory = A.Fake <IHttpClientFactory>();

            A.CallTo(() => httpClientFactory.CreateClient(null))
            .Returns(new HttpClient());

            sut = new TemplatesClient(httpClientFactory, Options.Create(new TemplatesOptions
            {
                Repositories = new[]
                {
                    new TemplateRepository
                    {
                        ContentUrl = "https://raw.githubusercontent.com/Squidex/templates/main"
                    }
                }
            }));
        }