Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }