public int Execute(string moduleName, string expectedOutput, OutputMatchKind outputMatchKind = OutputMatchKind.MatchAll) { string actualOutput; int exitCode = Execute(moduleName, expectedOutput.Length, out actualOutput); if (expectedOutput != null) { switch (outputMatchKind) { case OutputMatchKind.MatchAll: if (expectedOutput.Trim() != actualOutput.Trim()) { string dumpDir; assemblyManager.DumpAssemblyData(out dumpDir); throw new ExecutionException(expectedOutput, actualOutput, dumpDir); } break; case OutputMatchKind.DoesNotMatch: if (actualOutput.Contains(expectedOutput)) { string dumpDir; assemblyManager.DumpAssemblyData(out dumpDir); throw new ExecutionException(null, actualOutput, dumpDir); } break; default: throw new NotSupportedException("Unsupported OutputMatchKind: " + outputMatchKind.ToString()); } } return(exitCode); }
public int Execute(string moduleName, string expectedOutput, OutputMatchKind outputMatchKind = OutputMatchKind.MatchAll) { string actualOutput; int exitCode = Execute(moduleName, expectedOutput.Length, out actualOutput); if (expectedOutput != null) { switch (outputMatchKind) { case OutputMatchKind.MatchAll: if (expectedOutput.Trim() != actualOutput.Trim()) { string dumpDir; assemblyManager.DumpAssemblyData(out dumpDir); throw new ExecutionException(expectedOutput, actualOutput, dumpDir); } break; case OutputMatchKind.DoesNotMatch: if (actualOutput.Contains(expectedOutput)) { string dumpDir; assemblyManager.DumpAssemblyData(out dumpDir); throw new ExecutionException(null, actualOutput, dumpDir); } break; default: throw new NotSupportedException("Unsupported OutputMatchKind: " + outputMatchKind.ToString()); } } return exitCode; }