public void TestIsNotWithinParentDirectory() { 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/index.html"); TargetUrls.Add("http://www.companyname.com/path/to/some/deep/folder/sub-folder/sub-folder/index.html"); TargetUrls.Add("http://www.companyname.com/images/some-image.jpg"); TargetUrls.Add("http://www.companyname.com/path/to/some/folder/media/image"); JobMaster = new MacroscopeJobMaster( JobRunTimeMode: MacroscopeConstants.RunTimeMode.LIVE, TaskController: this ); JobMaster.SetStartUrl(Url: StartUrl); JobMaster.DetermineStartingDirectory(); foreach (string TargetUrl in TargetUrls) { Assert.IsFalse(JobMaster.IsWithinParentDirectory(TargetUrl), string.Format("FAIL: {0}", TargetUrl)); } }