Ejemplo n.º 1
0
        public async Task DeleteAsync_ReturnsError_Async()
        {
            const string sessionId = "session-id";
            var          response  = new WebDriverResponse();

            var webDriver = new Mock <KubernetesWebDriver>(MockBehavior.Strict);

            webDriver
            .Setup(w => w.DeleteSessionAsync(sessionId, default))
            .ReturnsAsync(response);

            var controller = new WebDriverController(webDriver.Object, NullLogger <WebDriverController> .Instance);
            var result     = await controller.DeleteAsync(sessionId, default).ConfigureAwait(false);

            Assert.Same(response, result.Value);
        }
Ejemplo n.º 2
0
        public async Task NewSessionAsync_InvokesDriver_Async()
        {
            var request  = new NewSessionRequest();
            var response = new WebDriverResponse();

            var webDriver = new Mock <KubernetesWebDriver>(MockBehavior.Strict);

            webDriver
            .Setup(w => w.CreateSessionAsync(request, default))
            .ReturnsAsync(response);

            var controller = new WebDriverController(webDriver.Object, NullLogger <WebDriverController> .Instance);
            var result     = await controller.NewSessionAsync(request, default).ConfigureAwait(false);

            Assert.Same(response, result.Value);
        }
Ejemplo n.º 3
0
 public async Task StatusAsync_ReturnsValue_Async()
 {
     var controller = new WebDriverController(Mock.Of <KubernetesWebDriver>(), NullLogger <WebDriverController> .Instance);
     var result     = await controller.StatusAsync(default).ConfigureAwait(false);