예제 #1
0
        public void SetACLForWebSite()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            runner.WaitForLog     = false;
            runner.WaitForStartup = false;

            //ACt
            runner.Run(new RunParameters()
            {
                WebSitePath = @"D:\LTAF\WebSite"
            });

            //Assert
            Assert.AreEqual(1, _fileSystem.DirectoryAccessRules.Count);
            Assert.IsTrue(_fileSystem.DirectoryAccessRules.ContainsKey(@"D:\LTAF\WebSite"));
        }
예제 #2
0
        public void CreateVDirForWebSite()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            runner.WaitForLog     = false;
            runner.WaitForStartup = false;

            //Act
            int code = runner.Run(new RunParameters()
            {
                WebSitePath = @"D:\LTAF\WebSite"
            });

            //Assert
            Assert.AreEqual("WebSite", _webSever.AppNames[0]);
            Assert.AreEqual("localhost", _webSever.ServerNames[0]);
            Assert.AreEqual(@"D:\LTAF\WebSite", _webSever.AppDirectories[0]);
        }
예제 #3
0
        public void CreateProcess()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            SimulateWebSiteTests(runner, @"D:\LTAF\WebSite", _fileSystem, "log content");


            //Act
            runner.Run(new RunParameters()
            {
                WebSitePath = @"D:\LTAF\WebSite",
            });


            //Assert
            Assert.AreEqual("http://localhost/WebSite/Test/Default.aspx?run=true&log=true&console=false", _os.CreateProcessArguments);
            Assert.AreEqual("iexplore.exe", _os.CreateProcessName);
        }
예제 #4
0
        public void KillProcess()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            SimulateWebSiteTests(runner, @"D:\LTAF\WebSite", _fileSystem, "log content");


            //Act
            runner.Run(new RunParameters()
            {
                WebSitePath = @"D:\LTAF\WebSite",
                TagName     = "foobar"
            });


            //Assert
            Assert.AreEqual("iexplore", _os.KillProcessName);
        }
예제 #5
0
        public void WebSiteNotFound()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            runner.WaitForLog     = false;
            runner.WaitForStartup = false;

            //Act
            int code = runner.Run(new RunParameters()
            {
                WebSitePath = @"D:\LTAF\Foo"
            });

            //Assert
            Assert.AreEqual(1, code);
            string logContent = _fileSystem.Files.Where(k => k.Key.Contains("LTAFRunner\\TestLog.txt")).First().Value;

            Assert.IsTrue(logContent.Contains("Test Run FAILED"), logContent);
            Assert.IsTrue(logContent.Contains("Path to website 'D:\\LTAF\\Foo' not found."), logContent);
        }
예제 #6
0
        public void WebSitePass()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            SimulateWebSiteTests(runner, @"D:\LTAF\WebSite", _fileSystem, "Testcase PASSED");

            //ACt
            int code = runner.Run(new RunParameters()
            {
                WebSitePath      = @"D:\LTAF\WebSite",
                ExecutionTimeout = 1000
            });

            //Assert
            Assert.AreEqual(0, code);
            string logContent = _fileSystem.Files.Where(k => k.Key.Contains("LTAFRunner\\TestLog.txt")).First().Value;

            Assert.IsTrue(logContent.Contains("Test Run PASSED"), logContent);
            Assert.IsTrue(logContent.Contains("Testcase PASSED"), logContent);
        }
예제 #7
0
        public void TimeoutIfStartupIsNotProduced()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            runner.PollForLogInMilliseconds     = 0;
            runner.StartupTimeoutInMilliseconds = 5;
            runner.WaitForStartup = true;

            //Act
            int code = runner.Run(new RunParameters()
            {
                WebSitePath = @"D:\LTAF\WebSite",
            });

            //Assert
            Assert.AreEqual(1, code);
            string logContent = _fileSystem.Files.Where(k => k.Key.Contains("LTAFRunner\\TestLog.txt")).First().Value;

            Assert.IsTrue(logContent.Contains("Timed out waiting for browser to start up."), logContent);
        }
예제 #8
0
        public void DeleteStartupBeforeRunning()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            _fileSystem.Files.Add(@"D:\LTAF\WebSite\Test\Startup.txt", "foo");

            SimulateWebSiteTests(runner, @"D:\LTAF\WebSite", _fileSystem, "log content");


            //Act
            runner.Run(new RunParameters()
            {
                WebSitePath = @"D:\LTAF\WebSite",
            });

            //Assert
            string logContent = _fileSystem.Files.Where(k => k.Key.Contains("Test\\Startup.txt")).First().Value;

            Assert.IsTrue(logContent.Contains("dummy startup"), logContent);
        }
예제 #9
0
        public void RelativePath()
        {
            //Arrange
            LTAFRunner runner = CreateRunner();

            _fileSystem.CurrentDirectory = @"D:\MyCompany\Product";
            _fileSystem.Directories.Add(@"D:\MyCompany\Product\WebSite");
            _fileSystem.Directories.Add(@"D:\MyCompany\Product\WebSite\Test");
            SimulateWebSiteTests(runner, @"D:\MyCompany\Product\WebSite", _fileSystem, "Testcase PASSED");

            //ACt
            int code = runner.Run(new RunParameters()
            {
                WebSitePath      = "WebSite",
                ExecutionTimeout = 1000
            });

            //Assert
            string logContent = _fileSystem.Files.Where(k => k.Key.Contains("Product\\TestLog.txt")).First().Value;

            Assert.IsTrue(logContent.Contains("Test Run PASSED"), logContent);
        }