Example #1
0
        private ITestE2E CreateTestE2E(string e2eFile)
        {
            string        file   = Path.Combine(Environment.CurrentDirectory, e2eFile);
            TestE2EReader reader = new TestE2EReader(CreateLoggerMock().Object);

            return(reader.ReadFile(file));
        }
Example #2
0
        public void IsLaunchedProgramMaximizedTest(string e2eFile, bool expectedValue)
        {
            string        file   = Path.Combine(Environment.CurrentDirectory, e2eFile);
            TestE2EReader reader = new TestE2EReader(CreateLoggerMock().Object);
            ITestE2E      e2e    = reader.ReadFile(file);

            Assert.Equal(expectedValue, e2e.MakeLaunchedProgramMaximized);
        }
Example #3
0
        public void TestStepCountTest(string e2eFile, int expectedCount)
        {
            string        file   = Path.Combine(Environment.CurrentDirectory, e2eFile);
            TestE2EReader reader = new TestE2EReader(CreateLoggerMock().Object);
            ITestE2E      e2e    = reader.ReadFile(file);

            Assert.Equal(expectedCount, e2e.Steps.Count);
        }
Example #4
0
        public void SearchScreenAreaTest(string e2eFile, int stepIndex, List <ScreenSearchArea> expectedAreas)
        {
            string        file   = Path.Combine(Environment.CurrentDirectory, e2eFile);
            TestE2EReader reader = new TestE2EReader(CreateLoggerMock().Object);
            ITestE2E      e2e    = reader.ReadFile(file);

            IReadOnlyList <ScreenSearchArea> actualAreas = e2e.Steps[stepIndex].SearchArea;

            Assert.Equal(expectedAreas, actualAreas);
        }
Example #5
0
        public void EnvironmentVariableTest(string e2eFile, string environmentName, string expectedValue)
        {
            string originalValue = Environment.GetEnvironmentVariable(environmentName);

            Environment.SetEnvironmentVariable(environmentName, expectedValue);
            string        file   = Path.Combine(Environment.CurrentDirectory, e2eFile);
            TestE2EReader reader = new TestE2EReader(CreateLoggerMock().Object);
            ITestE2E      e2e    = reader.ReadFile(file);

            // according to this e2e file, get the first step and get its ActionArgument
            Assert.Equal(expectedValue, e2e.Steps[0].ActionArgument);

            // revert environment variable
            Environment.SetEnvironmentVariable(environmentName, originalValue);
        }