예제 #1
0
        void VerifyMultipleFilesAndPolicies(string rootDirectory, AdditionalResultsWorker resultWriter)
        {
            foreach (string directory in Directory.GetDirectories(rootDirectory))
            {
                if (directory.EndsWith(".svn", StringComparison.InvariantCultureIgnoreCase))
                    continue;

                IUroPolicyEngine engine = MTAReportHelpersFactory.CreateUroPolicyEngineWithPolicyCache(PathHelpers.Concatenate(directory, "Policies"));
                IUniversalRequestObject uro = MTAReportHelpersFactory.CreateUro(new DirectoryBasedRequestAttachmentProvider(PathHelpers.Concatenate(directory, "Files")));

                // DirectoryName should be a good indicator of the test name.
                string testName = directory.Substring(directory.LastIndexOf(Path.DirectorySeparatorChar) + 1);
                EATResultInfo info = new EATResultInfo(resultWriter, testName);

                IPolicyEngineTestAction action = TestActionFactory.CreateGenerateReportAndVerifyForEATAction(engine, PathHelpers.Concatenate(directory, "result.xml"), info);
                action.Execute(uro);
            }
        }
예제 #2
0
 public static IPolicyEngineTestAction CreateGenerateReportAndVerifyForEATAction(IUroPolicyEngine engine, string fileName, EATResultInfo info)
 {
     return new VerifyReportAndWriteToEAT(engine, fileName, info);
 }
예제 #3
0
 public VerifyReportAndWriteToEAT(IUroPolicyEngine engine, string previousReportName, EATResultInfo info)
     : base(engine)
 {
     this.previousReportName = previousReportName;
     this.info = info;
 }