Ejemplo n.º 1
0
        public IntegrationTest(DatabaseFixture fixture)
        {
            this.fixture = fixture;

            server = new TestServer(new WebHostBuilder()
                                    .ConfigureServices(services =>
            {
                fixture.ConfigureServices(services);

                services.AddSingleton <IRtspService>(s =>
                {
                    var handler = server.CreateHandler();
                    return(new HttpRtspService(new HttpClient(new HttpResponseLogger(response =>
                    {
                        // keep track of the latest response so we can assert against it
                        this.response = response;
                    }, handler))
                    {
                        BaseAddress = new Uri("http://example.com/")
                    }));
                });
            })
                                    .UseStartup <TestStartup>()
                                    );

            api = Services.GetRequiredService <IRtspService>();
        }
Ejemplo n.º 2
0
 public VideoController(VideoConverter videos, IRtspService api, IOptions <StreamingOptions> opts)
 {
     this.videos = videos;
     this.api    = api;
     this.opts   = opts.Value;
 }