コード例 #1
0
        public void TestIsWithinChildDirectory()
        {
            MacroscopeJobMaster JobMaster;
            const string        StartUrl   = "http://www.companyname.com/path/to/some/deep/folder/index.html";
            List <string>       TargetUrls = new List <string> ();

            TargetUrls.Add("http://www.companyname.com/path/to/some/deep/folder/sub-folder/sub-folder/index.html");
            TargetUrls.Add("http://www.companyname.com/path/to/some/deep/folder/sub-folder/image");

            JobMaster = new MacroscopeJobMaster(
                JobRunTimeMode: MacroscopeConstants.RunTimeMode.LIVE,
                TaskController: this
                );

            JobMaster.SetStartUrl(Url: StartUrl);

            JobMaster.DetermineStartingDirectory();

            foreach (string Url in TargetUrls)
            {
                Assert.IsTrue(JobMaster.IsWithinChildDirectory(Url), string.Format("FAIL: {0}", Url));
            }
        }