public async Task API_StartTest()
        {
            var widget  = new TestWidget();
            var handler = new Start();
            var request = StartRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);
        }
        public async Task API_HealthCheckTest()
        {
            var widget  = new TestWidget();
            var handler = new CheckHealth();
            var request = HealthCheckRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);
        }
        public async Task API_InitializeTest()
        {
            var widget  = new TestWidget();
            var handler = new Initializer();
            var request = InitializeRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);
        }
Beispiel #4
0
        public async Task API_OpenWebPageTest()
        {
            var widget  = new TestWidget();
            var handler = new OpenWebPage();
            var request = OpenWebPageRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);
        }
        public async Task API_MetricQueryTest()
        {
            var widget  = new TestWidget();
            var handler = new MetricQuery();
            var request = MetricQueryRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);

            Assert.AreEqual(1, widget.Value);
        }
Beispiel #6
0
        public async Task API_OpenWebPageTest2()
        {
            var processStarter = Substitute.For <IProcessStarter>();

            const string url = "invalid-uri";

            var widget = new TestWidget
            {
                URL = url
            };

            var handler = new OpenWebPage <TestWidget>(processStarter);
            var request = OpenWebPageRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);
        }
Beispiel #7
0
        public async Task API_OpenWebPageTest()
        {
            var processStarter = Substitute.For <IProcessStarter>();

            const string URL = "https://test-url.com";

            var widget = new TestWidget
            {
                URL = URL
            };

            var handler = new OpenWebPage <TestWidget>(processStarter);
            var request = OpenWebPageRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);

            processStarter.Received().Start(URL);
        }