コード例 #1
0
        public void Should_Set_Working_Directory()
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            // When
            var result = fixture.Run();

            // Then
            Assert.Equal("/Working", result.Process.WorkingDirectory.FullPath);
        }
コード例 #2
0
        public void Should_Add_Config_Argument()
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            // When
            var result = fixture.Run();

            // Then
            result.Args.Should().Be("config");
        }
コード例 #3
0
        public void Should_Find_Genymotion_If_Tool_Path_Not_Provided()
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            // When
            var result = fixture.Run();

            // Then
            Assert.Equal("/Working/tools/gmtool.exe", result.Path.FullPath);
        }
コード例 #4
0
        public void Should_Add_Config_ProxyAddress_Argument(string value, string expected)
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.Settings.ProxyAddress = value;

            // When
            var result = fixture.Run();

            // Then
            result.Args.Should().Be(expected);
        }
コード例 #5
0
        public void Should_Add_Verbose_Flag_To_Arguments_If_Set(bool verbose, string expected)
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.Settings.Verbose = verbose;

            // When
            var result = fixture.Run();

            // Then
            result.Args.Should().Be(expected);
        }
コード例 #6
0
        public void Should_Add_Timeout_Flag_To_Arguments_If_Set(int?timeout, string expected)
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.Settings.Timeout = timeout;

            // When
            var result = fixture.Run();

            // Then
            result.Args.Should().Be(expected);
        }
コード例 #7
0
        public void Should_Add_Config_Statistics_Argument(bool value, string expected)
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.Settings.EnableStatistics = value;

            // When
            var result = fixture.Run();

            // Then
            result.Args.Should().Be(expected);
        }
コード例 #8
0
        public void Should_Add_Config_VirtualDevicePath_Argument(string value, string expected)
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.Settings.VirtualDevicePath = value;

            // When
            var result = fixture.Run();

            // Then
            result.Args.Should().Be(expected);
        }
コード例 #9
0
        public void Should_Add_Config_UseCustomSDK_Argument(bool value, string expected)
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.Settings.UseCustomSdk = value;

            // When
            var result = fixture.Run();

            // Then
            result.Args.Should().Be(expected);
        }
コード例 #10
0
        public void Should_Throw_If_Process_Was_Not_Started()
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.GivenProcessCannotStart();

            // When
            fixture.Invoking(x => x.Run())

            // Then
            .ShouldThrow <CakeException>()
            .WithMessage("Genymotion: Process was not started.");
        }
コード例 #11
0
        public void Should_Throw_If_Has_A_Non_Zero_Exit_Code()
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.GivenProcessExitsWithCode(1);

            // When
            fixture.Invoking(x => x.Run())

            // Then
            .ShouldThrow <CakeException>()
            .WithMessage("Genymotion: Process returned an error (exit code 1).");
        }
コード例 #12
0
        public void Should_Throw_If_Genymotion_Was_Not_Found()
        {
            // Given
            var fixture = new GenymotionConfigFixture();

            fixture.GivenDefaultToolDoNotExist();

            // When
            fixture.Invoking(x => x.Run())

            // Then
            .ShouldThrow <CakeException>()
            .WithMessage("Genymotion: Could not locate executable.");
        }
コード例 #13
0
        public void Should_Use_Genymotion_Runner_From_Tool_Path_If_Provided(string toolPath, string expected)
        {
            // Given
            var fixture = new GenymotionConfigFixture {
                Settings = { ToolPath = toolPath }
            };

            fixture.GivenSettingsToolPathExist();

            // When
            var result = fixture.Run();

            // Then
            result.Path.FullPath.Should().Be(expected);
        }