diff --git a/Installer/ImportGherkinParser/Program.cs b/Installer/ImportGherkinParser/Program.cs index 3eef643d8..ed15f0f1a 100644 --- a/Installer/ImportGherkinParser/Program.cs +++ b/Installer/ImportGherkinParser/Program.cs @@ -92,6 +92,7 @@ private static void CreateSignedParser(string gherkinParserFullPath, Version ver new Dictionary() { {"se", "sv"}, + {"lu", "lb-LU"}, }; private class KeywordTranslation diff --git a/Languages.xml b/Languages.xml index 49511835a..f04357e95 100644 --- a/Languages.xml +++ b/Languages.xml @@ -219,8 +219,11 @@ Forgatókönyv Forgatókönyv vázlat Példák - Ha + Amennyiben + Adott Majd + Ha + Amikor Akkor És De @@ -250,8 +253,11 @@ Forgatókönyv Forgatókönyv vázlat Példák - Ha + Amennyiben + Adott Majd + Ha + Amikor Akkor És De @@ -262,8 +268,11 @@ Forgatókönyv Forgatókönyv vázlat Példák - Ha + Amennyiben + Adott Majd + Ha + Amikor Akkor És De @@ -328,6 +337,20 @@ Ir Bet + + Funktionalitéit + Hannergrond + Szenario + Plang vum Szenario + Beispiller + ugeholl + wann + dann + an + a + awer + + Funkcionalitāte Fīča @@ -427,8 +450,12 @@ Структура сценария Значения Допустим + Дано + Пусть Если + Когда То + Тогда И К тому же Но @@ -452,8 +479,11 @@ Forgatókönyv Forgatókönyv vázlat Példák - Ha + Amennyiben + Adott Majd + Ha + Amikor Akkor És De @@ -464,8 +494,11 @@ Forgatókönyv Forgatókönyv vázlat Példák - Ha + Amennyiben + Adott Majd + Ha + Amikor Akkor És De @@ -504,9 +537,14 @@ Припустимо Припустимо, що Нехай + Дано Якщо + Коли То + Тоді І + А також + Та Але diff --git a/Parser/GherkinBuilder/BackgroundBuilder.cs b/Parser/GherkinBuilder/BackgroundBuilder.cs index 08996185e..ac1170a37 100644 --- a/Parser/GherkinBuilder/BackgroundBuilder.cs +++ b/Parser/GherkinBuilder/BackgroundBuilder.cs @@ -10,9 +10,9 @@ internal class BackgroundBuilder : IStepProcessor private readonly FilePosition position; private readonly IList steps = new List(); - public BackgroundBuilder(string text, FilePosition position) + public BackgroundBuilder(string name, string description, FilePosition position) { - this.text = text; + this.text = TextHelper.GetText(name, description); this.position = position; } diff --git a/Parser/GherkinBuilder/ExampleBuilder.cs b/Parser/GherkinBuilder/ExampleBuilder.cs index 23eefe135..1e077bca9 100644 --- a/Parser/GherkinBuilder/ExampleBuilder.cs +++ b/Parser/GherkinBuilder/ExampleBuilder.cs @@ -11,9 +11,9 @@ internal class ExampleBuilder : ITableProcessor private readonly FilePosition position; private readonly TableBuilder tableBuilder = new TableBuilder(); - public ExampleBuilder(string text, FilePosition position) + public ExampleBuilder(string name, string description, FilePosition position) { - this.text = text; + this.text = TextHelper.GetText(name, description); this.position = position; } diff --git a/Parser/GherkinBuilder/FeatureBuilder.cs b/Parser/GherkinBuilder/FeatureBuilder.cs index a6f41d9ba..a6ef6c73e 100644 --- a/Parser/GherkinBuilder/FeatureBuilder.cs +++ b/Parser/GherkinBuilder/FeatureBuilder.cs @@ -1,43 +1,41 @@ using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; using TechTalk.SpecFlow.Parser.SyntaxElements; namespace TechTalk.SpecFlow.Parser.GherkinBuilder { internal class FeatureBuilder { - private readonly string text; - private readonly Tags tags; + private string title; + private string description; + private string sourceFilePath; + private Tags tags; private readonly IList scenarios = new List(); private BackgroundBuilder background = null; - public FeatureBuilder(string text, Tags tags) + public string SourceFilePath { - this.text = text; - this.tags = tags; + get { return sourceFilePath; } + set { sourceFilePath = value; } } - private static readonly Regex firstLineRe = new Regex(@"^(?[^\r\n]*)[\r\n]+(?.*)", RegexOptions.Singleline); + public void SetHeader(string title, string description, Tags tags) + { + this.title = title; + this.description = description; + this.tags = tags; + } public Feature GetResult() { - string title = text; - string description = null; - - var match = firstLineRe.Match(text); - if (match.Success) - { - title = match.Groups["firstline"].Value; - description = match.Groups["rest"].Value; - } - - return new Feature( + var feature = new Feature( title, tags, description, background == null ? null : background.GetResult(), scenarios.Select(sb => sb.GetResult()).ToArray()); + feature.SourceFile = sourceFilePath; + return feature; } public void AddScenario(IScenarioBuilder scenarioBuilder) diff --git a/Parser/GherkinBuilder/GherkinListener.cs b/Parser/GherkinBuilder/GherkinListener.cs index b6c874906..16703fa28 100644 --- a/Parser/GherkinBuilder/GherkinListener.cs +++ b/Parser/GherkinBuilder/GherkinListener.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Globalization; using System.Linq; using gherkin; using java.util; @@ -13,7 +12,7 @@ internal class GherkinListener : Listener { public GherkinListener(I18n languageService) { - _i18n = languageService; + i18n = languageService; Errors = new List(); } @@ -32,7 +31,8 @@ public void RegisterError(ErrorDetail errorDetail) Errors.Add(errorDetail); } - private FeatureBuilder featureBuilder; + private readonly FeatureBuilder featureBuilder = new FeatureBuilder(); + public Feature GetResult() { return featureBuilder.GetResult(); @@ -49,7 +49,7 @@ private Tags FlushTags() private IStepProcessor stepProcessor; private ITableProcessor tableProcessor; private IExampleProcessor exampleProcessor; - private I18n _i18n; + private readonly I18n i18n; public void tag(string name, int i) { @@ -57,59 +57,64 @@ public void tag(string name, int i) tags.Add(new Tag(nameWithoutAt)); } - public void comment(string str, int i) + public void comment(string comment, int line) + { + } + + public void location(string uri, int offset) { + featureBuilder.SourceFilePath = uri; } - public void feature(string keyword, string content, int line_number) + public void feature(string keyword, string name, string description, int line) { - featureBuilder = new FeatureBuilder(content, FlushTags()); + featureBuilder.SetHeader(name, description, FlushTags()); } - public void background(string keyword, string content, int line_number) + public void background(string keyword, string name, string description, int line) { - var background = new BackgroundBuilder(content, new FilePosition(line_number, 1)); + var background = new BackgroundBuilder(name, description, new FilePosition(line)); stepProcessor = background; featureBuilder.AddBackground(background); } - public void scenario(string keyword, string content, int line_number) + public void scenario(string keyword, string name, string description, int line) { - var currentScenario = new ScenarioBuilder(content, FlushTags(), new FilePosition(line_number, 1)); + var currentScenario = new ScenarioBuilder(name, description, FlushTags(), new FilePosition(line)); stepProcessor = currentScenario; featureBuilder.AddScenario(currentScenario); } - public void scenarioOutline(string keyword, string content, int line_number) + public void scenarioOutline(string keyword, string name, string description, int line) { - var currentScenario = new ScenarioOutlineBuilder(content, FlushTags(), new FilePosition(line_number, 1)); + var currentScenario = new ScenarioOutlineBuilder(name, description, FlushTags(), new FilePosition(line)); stepProcessor = currentScenario; exampleProcessor = currentScenario; featureBuilder.AddScenario(currentScenario); } - public void examples(string keyword, string content, int line_number) + public void examples(string keyword, string name, string description, int line) { - var exampleBuilder = new ExampleBuilder(content, new FilePosition(line_number, 1)); + var exampleBuilder = new ExampleBuilder(name, description, new FilePosition(line)); tableProcessor = exampleBuilder; exampleProcessor.ProcessExample(exampleBuilder); } - public void step(string keyword, string content, int line_number) + public void step(string keyword, string text, int line) { - stepBuilder = new StepBuilder(keyword, content, new FilePosition(line_number, 1), _i18n); + stepBuilder = new StepBuilder(keyword, text, new FilePosition(line), i18n); tableProcessor = stepBuilder; stepProcessor.ProcessStep(stepBuilder); } - public void row(List list, int line_number) + public void row(List list, int line) { string[] rows = new string[list.size()]; list.toArray(rows); - tableProcessor.ProcessTableRow(rows, line_number); + tableProcessor.ProcessTableRow(rows, line); } - public void pyString(string content, int line_number) + public void pyString(string content, int line) { stepBuilder.SetMultilineArg(content); } @@ -119,12 +124,11 @@ public void eof() } - public void syntaxError(string str1, string str2, List l, int line_number) + public void syntaxError(string state, string eventName, List legalEvents, int line) { - string message = "Parse error. Found " + str1 + " when expecting one of: " + - "TODO" + ". (Current state: " + str2 + ")."; + string message = string.Format("Parser error on line {2}. State: {0}, Event: {1}", state, eventName, line); - RegisterError(line_number, null, message); + RegisterError(line, null, message); } } } diff --git a/Parser/GherkinBuilder/ScenarioBuilder.cs b/Parser/GherkinBuilder/ScenarioBuilder.cs index 5a6f6b2b2..af9442b97 100644 --- a/Parser/GherkinBuilder/ScenarioBuilder.cs +++ b/Parser/GherkinBuilder/ScenarioBuilder.cs @@ -6,14 +6,14 @@ namespace TechTalk.SpecFlow.Parser.GherkinBuilder { internal class ScenarioBuilder : IScenarioBuilder { - private readonly string name; + private readonly string title; private readonly FilePosition position; private readonly Tags tags; private readonly IList steps = new List(); - public ScenarioBuilder(string name, Tags tags, FilePosition position) + public ScenarioBuilder(string name, string description, Tags tags, FilePosition position) { - this.name = name; + this.title = TextHelper.GetText(name, description); this.position = position; this.tags = tags; } @@ -25,7 +25,7 @@ public void ProcessStep(StepBuilder step) public Scenario GetResult() { - return new Scenario(name, tags, new ScenarioSteps(steps.Select(s => s.GetResult()).ToArray())) { FilePosition = position }; + return new Scenario(title, tags, new ScenarioSteps(steps.Select(s => s.GetResult()).ToArray())) { FilePosition = position }; } } } \ No newline at end of file diff --git a/Parser/GherkinBuilder/ScenarioOutlineBuilder.cs b/Parser/GherkinBuilder/ScenarioOutlineBuilder.cs index f25e694b4..be423e443 100644 --- a/Parser/GherkinBuilder/ScenarioOutlineBuilder.cs +++ b/Parser/GherkinBuilder/ScenarioOutlineBuilder.cs @@ -7,15 +7,15 @@ namespace TechTalk.SpecFlow.Parser.GherkinBuilder { internal class ScenarioOutlineBuilder : IScenarioBuilder, IExampleProcessor { - private readonly string name; + private readonly string title; private readonly Tags tags; private readonly FilePosition position; private readonly IList steps = new List(); private readonly IList examples = new List(); - public ScenarioOutlineBuilder(string name, Tags tags, FilePosition position) + public ScenarioOutlineBuilder(string name, string description, Tags tags, FilePosition position) { - this.name = name; + this.title = TextHelper.GetText(name, description); this.tags = tags; this.position = position; } @@ -37,7 +37,7 @@ public Scenario GetResult() }); return new ScenarioOutline( - name, + title, tags, new ScenarioSteps(steps.Select(step => step.GetResult()).ToArray()), new Examples(examples.Select(example => example.GetResult()).ToArray())) { FilePosition = position }; diff --git a/Parser/GherkinBuilder/TableBuilder.cs b/Parser/GherkinBuilder/TableBuilder.cs index 75183bad0..4bdd46ab0 100644 --- a/Parser/GherkinBuilder/TableBuilder.cs +++ b/Parser/GherkinBuilder/TableBuilder.cs @@ -17,7 +17,7 @@ public Table GetResult() public void ProcessTableRow(string[] cells, int lineNumber) { var row = new Row(cells.Select(c => new Cell(c)).ToArray()); - row.FilePosition = new FilePosition(lineNumber, 1); + row.FilePosition = new FilePosition(lineNumber); if (tableRows.Count > 0 && tableRows[0].Cells.Length != row.Cells.Length) { diff --git a/Parser/GherkinBuilder/TextHelper.cs b/Parser/GherkinBuilder/TextHelper.cs new file mode 100644 index 000000000..2ef7fa3cd --- /dev/null +++ b/Parser/GherkinBuilder/TextHelper.cs @@ -0,0 +1,15 @@ +using System; + +namespace TechTalk.SpecFlow.Parser.GherkinBuilder +{ + public static class TextHelper + { + public static string GetText(string name, string description) + { + if (string.IsNullOrEmpty(description)) + return name; + + return string.Concat(name, Environment.NewLine, description); + } + } +} \ No newline at end of file diff --git a/Parser/SpecFlowLangParser.cs b/Parser/SpecFlowLangParser.cs index 38714ea6f..b2a7bc015 100644 --- a/Parser/SpecFlowLangParser.cs +++ b/Parser/SpecFlowLangParser.cs @@ -22,14 +22,7 @@ public SpecFlowLangParser(CultureInfo defaultLanguage) this.defaultLanguage = defaultLanguage; } - public Feature Parse(TextReader featureFileReader, string sourceFileName) - { - var feature = Parse(featureFileReader); - feature.SourceFile = Path.GetFullPath(sourceFileName); - return feature; - } - - public Feature Parse(TextReader featureFileReader) + public Feature Parse(TextReader featureFileReader, string sourceFilePath) { var fileContent = featureFileReader.ReadToEnd(); @@ -37,7 +30,7 @@ public Feature Parse(TextReader featureFileReader) I18n languageService = new I18n(language.CompatibleGherkinLanguage ?? language.Language); var gherkinListener = new GherkinListener(languageService); - Feature feature = Parse(fileContent, gherkinListener, languageService); + Feature feature = Parse(fileContent, sourceFilePath, gherkinListener, languageService); if (gherkinListener.Errors.Count > 0) throw new SpecFlowParserException(gherkinListener.Errors); @@ -48,12 +41,12 @@ public Feature Parse(TextReader featureFileReader) return feature; } - private Feature Parse(string fileContent, GherkinListener gherkinListener, I18n languageService) + private Feature Parse(string fileContent, string sourceFilePath, GherkinListener gherkinListener, I18n languageService) { try { Lexer lexer = languageService.lexer(gherkinListener); - lexer.scan(fileContent); + lexer.scan(fileContent, sourceFilePath, 0); return gherkinListener.GetResult(); } catch(SpecFlowParserException specFlowParserException) diff --git a/Parser/SyntaxElements/FilePosition.cs b/Parser/SyntaxElements/FilePosition.cs index 5adb01439..5c1ca87a0 100644 --- a/Parser/SyntaxElements/FilePosition.cs +++ b/Parser/SyntaxElements/FilePosition.cs @@ -15,10 +15,15 @@ public FilePosition() { } + public FilePosition(int line) + : this(line, 1) // default if the colum is not specified/available + { + } + public FilePosition(int line, int column) { Line = line; - Column = column; //NOTE: this is always 1 now since it is not provided by gherkin... + Column = column; } } } \ No newline at end of file diff --git a/Parser/TechTalk.SpecFlow.Parser.csproj b/Parser/TechTalk.SpecFlow.Parser.csproj index fbe90559a..05968a9b7 100644 --- a/Parser/TechTalk.SpecFlow.Parser.csproj +++ b/Parser/TechTalk.SpecFlow.Parser.csproj @@ -79,6 +79,7 @@ + diff --git a/Reporting/NUnitExecutionReport/NUnitExecutionReportGenerator.cs b/Reporting/NUnitExecutionReport/NUnitExecutionReportGenerator.cs index 79038052e..55acb2127 100644 --- a/Reporting/NUnitExecutionReport/NUnitExecutionReportGenerator.cs +++ b/Reporting/NUnitExecutionReport/NUnitExecutionReportGenerator.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.Globalization; using System.IO; -using System.Linq; -using System.Text; using System.Xml; using System.Xml.Serialization; using TechTalk.SpecFlow.Generator.Configuration; @@ -15,24 +13,15 @@ public class NUnitExecutionReportGenerator { private ReportElements.NUnitExecutionReport report; private readonly SpecFlowProject specFlowProject; - private readonly string xmlTestResultPath; - private readonly string labeledTestOutputPath; + private readonly NUnitExecutionReportParameters reportParameters; - public NUnitExecutionReportGenerator(string projectFile, string xmlTestResultPath, string labeledTestOutputPath) - { - this.xmlTestResultPath = xmlTestResultPath; - this.specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(projectFile); - this.labeledTestOutputPath = labeledTestOutputPath; - } - - public NUnitExecutionReportGenerator(SpecFlowProject specFlowProject, string xmlTestResultPath, string labeledTestOutputPath) - { - this.xmlTestResultPath = xmlTestResultPath; - this.specFlowProject = specFlowProject; - this.labeledTestOutputPath = labeledTestOutputPath; + public NUnitExecutionReportGenerator(NUnitExecutionReportParameters reportParameters) + { + specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(reportParameters.ProjectFile); + this.reportParameters = reportParameters; } - public void GenerateReport() + private void GenerateReport() { report = new ReportElements.NUnitExecutionReport(); report.ProjectName = specFlowProject.ProjectName; @@ -41,9 +30,9 @@ public void GenerateReport() XmlDocument xmlTestResult = LoadXmlTestResult(); report.NUnitXmlTestResult = xmlTestResult.DocumentElement; - if (File.Exists(labeledTestOutputPath)) + if (File.Exists(reportParameters.LabelledTestOutput)) { - using(var reader = new StreamReader(labeledTestOutputPath)) + using(var reader = new StreamReader(reportParameters.LabelledTestOutput)) { string currentTest = "unknown"; List testLines = new List(); @@ -84,25 +73,31 @@ private XmlDocument LoadXmlTestResult() XmlDocument xmlTestResult = new XmlDocument(); XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable()); nsmgr.AddNamespace("", ReportElements.NUnitExecutionReport.XmlNUnitNamespace); - using(XmlReader reader = XmlReader.Create(xmlTestResultPath, new XmlReaderSettings(), new XmlParserContext(null, nsmgr, null, XmlSpace.None))) + using(XmlReader reader = XmlReader.Create(reportParameters.XmlTestResult, new XmlReaderSettings(), new XmlParserContext(null, nsmgr, null, XmlSpace.None))) { xmlTestResult.Load(reader); } return xmlTestResult; } - public void TransformReport(string outputFilePath) + private void TransformReport() { XmlSerializer serializer = new XmlSerializer(typeof(ReportElements.NUnitExecutionReport), ReportElements.NUnitExecutionReport.XmlNamespace); - if (XsltHelper.IsXmlOutput(outputFilePath)) + if (XsltHelper.IsXmlOutput(reportParameters.OutputFile)) { - XsltHelper.TransformXml(serializer, report, outputFilePath); + XsltHelper.TransformXml(serializer, report, reportParameters.OutputFile); } else { - XsltHelper.TransformHtml(serializer, report, GetType(), outputFilePath, specFlowProject.GeneratorConfiguration); + XsltHelper.TransformHtml(serializer, report, GetType(), reportParameters.OutputFile, specFlowProject.GeneratorConfiguration, reportParameters.XsltFile); } } + + public void GenerateAndTransformReport() + { + GenerateReport(); + TransformReport(); + } } } diff --git a/Reporting/NUnitExecutionReport/NUnitExecutionReportParameters.cs b/Reporting/NUnitExecutionReport/NUnitExecutionReportParameters.cs new file mode 100644 index 000000000..b49bbf7b2 --- /dev/null +++ b/Reporting/NUnitExecutionReport/NUnitExecutionReportParameters.cs @@ -0,0 +1,17 @@ +using System.IO; + +namespace TechTalk.SpecFlow.Reporting.NUnitExecutionReport +{ + public class NUnitExecutionReportParameters : ReportParameters + { + public string LabelledTestOutput { get; private set; } + public string XmlTestResult { get; private set; } + + public NUnitExecutionReportParameters(string projectFile, string xmlTestResult, string labelledTestOutput, string outputFile, string xsltFile) + : base(projectFile, outputFile, xsltFile) + { + this.XmlTestResult = Path.GetFullPath(xmlTestResult); + this.LabelledTestOutput = Path.GetFullPath(labelledTestOutput); + } + } +} \ No newline at end of file diff --git a/Reporting/ReportParameters.cs b/Reporting/ReportParameters.cs new file mode 100644 index 000000000..8eabead2c --- /dev/null +++ b/Reporting/ReportParameters.cs @@ -0,0 +1,18 @@ +using System.IO; + +namespace TechTalk.SpecFlow.Reporting +{ + public abstract class ReportParameters + { + public string XsltFile { get; private set; } + public string OutputFile { get; private set; } + public string ProjectFile { get; private set; } + + protected ReportParameters(string projectFile, string outputFile, string xsltFile) + { + this.ProjectFile = projectFile; + this.OutputFile = Path.GetFullPath(outputFile); + this.XsltFile = Path.GetFullPath(xsltFile); + } + } +} \ No newline at end of file diff --git a/Reporting/StepDefinitionReport/StepDefinitionReportGenerator.cs b/Reporting/StepDefinitionReport/StepDefinitionReportGenerator.cs index ff8605cdd..cd2c0fc85 100644 --- a/Reporting/StepDefinitionReport/StepDefinitionReportGenerator.cs +++ b/Reporting/StepDefinitionReport/StepDefinitionReportGenerator.cs @@ -6,9 +6,7 @@ using System.Linq; using System.Text; using System.Text.RegularExpressions; -using System.Xml; using System.Xml.Serialization; -using System.Xml.Xsl; using TechTalk.SpecFlow.Generator.Configuration; using TechTalk.SpecFlow.Parser.SyntaxElements; using TechTalk.SpecFlow.Reporting.StepDefinitionReport.ReportElements; @@ -17,34 +15,25 @@ namespace TechTalk.SpecFlow.Reporting.StepDefinitionReport { public class StepDefinitionReportGenerator { + public StepDefinitionReportParameters ReportParameters { get; set; } private readonly SpecFlowProject specFlowProject; private readonly List bindings; private readonly List parsedFeatures; - private readonly bool showBindingsWithoutInsance; private ReportElements.StepDefinitionReport report; private Dictionary stepDefByBinding; private Dictionary bindingByStepDef; private readonly List stepDefsWithNoBinding = new List(); - public StepDefinitionReportGenerator(string projectFile, string binFolder, bool showBindingsWithoutInsance) + public StepDefinitionReportGenerator(StepDefinitionReportParameters reportParameters) { - specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(projectFile); + ReportParameters = reportParameters; + specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(reportParameters.ProjectFile); parsedFeatures = ParserHelper.GetParsedFeatures(specFlowProject); - var basePath = Path.Combine(specFlowProject.ProjectFolder, binFolder); + var basePath = Path.Combine(specFlowProject.ProjectFolder, reportParameters.BinFolder); bindings = BindingCollector.CollectBindings(specFlowProject, basePath); - - this.showBindingsWithoutInsance = showBindingsWithoutInsance; - } - - public StepDefinitionReportGenerator(SpecFlowProject specFlowProject, List bindings, List parsedFeatures, bool showBindingsWithoutInsance) - { - this.specFlowProject = specFlowProject; - this.showBindingsWithoutInsance = showBindingsWithoutInsance; - this.bindings = bindings; - this.parsedFeatures = parsedFeatures; } public ReportElements.StepDefinitionReport GenerateReport() @@ -52,7 +41,7 @@ public ReportElements.StepDefinitionReport GenerateReport() report = new ReportElements.StepDefinitionReport(); report.ProjectName = specFlowProject.ProjectName; report.GeneratedAt = DateTime.Now.ToString("g", CultureInfo.InvariantCulture); - report.ShowBindingsWithoutInsance = showBindingsWithoutInsance; + report.ShowBindingsWithoutInsance = ReportParameters.ShowBindingsWithoutInsance; stepDefByBinding = new Dictionary(); bindingByStepDef = new Dictionary(); @@ -215,17 +204,17 @@ private string GetSampleText(BindingInfo bindingInfo) return sampleText; } - public void TransformReport(string outputFilePath) + public void TransformReport() { XmlSerializer serializer = new XmlSerializer(typeof(ReportElements.StepDefinitionReport), ReportElements.StepDefinitionReport.XmlNamespace); - if (XsltHelper.IsXmlOutput(outputFilePath)) + if (XsltHelper.IsXmlOutput(ReportParameters.OutputFile)) { - XsltHelper.TransformXml(serializer, report, outputFilePath); + XsltHelper.TransformXml(serializer, report, ReportParameters.OutputFile); } else { - XsltHelper.TransformHtml(serializer, report, GetType(), outputFilePath, specFlowProject.GeneratorConfiguration); + XsltHelper.TransformHtml(serializer, report, GetType(), ReportParameters.OutputFile, specFlowProject.GeneratorConfiguration, ReportParameters.XsltFile); } } @@ -355,5 +344,12 @@ private ScenarioStep CloneTo(ScenarioStep step, string currentBlock) newStep.TableArg = Clone(step.TableArg); return newStep; } + + + public void GenerateAndTransformReport() + { + GenerateReport(); + TransformReport(); + } } } \ No newline at end of file diff --git a/Reporting/StepDefinitionReport/StepDefinitionReportParameters.cs b/Reporting/StepDefinitionReport/StepDefinitionReportParameters.cs new file mode 100644 index 000000000..8b7ccce5d --- /dev/null +++ b/Reporting/StepDefinitionReport/StepDefinitionReportParameters.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TechTalk.SpecFlow.Reporting.StepDefinitionReport +{ + public class StepDefinitionReportParameters : ReportParameters + { + public string BinFolder { get; private set; } + public bool ShowBindingsWithoutInsance { get; private set; } + + public StepDefinitionReportParameters(string projectFile, string outputFile, string xsltFile, string binFolder, bool showBindingsWithoutInsance) + : base(projectFile, outputFile, xsltFile) + { + BinFolder = binFolder; + ShowBindingsWithoutInsance = showBindingsWithoutInsance; + } + } +} diff --git a/Reporting/TechTalk.SpecFlow.Reporting.csproj b/Reporting/TechTalk.SpecFlow.Reporting.csproj index 22d82304c..9369e8bff 100644 --- a/Reporting/TechTalk.SpecFlow.Reporting.csproj +++ b/Reporting/TechTalk.SpecFlow.Reporting.csproj @@ -59,6 +59,7 @@ + @@ -72,6 +73,8 @@ + + diff --git a/Reporting/XmlResourceResolver.cs b/Reporting/XmlResourceResolver.cs index df8cf2e3a..c0af16d90 100644 --- a/Reporting/XmlResourceResolver.cs +++ b/Reporting/XmlResourceResolver.cs @@ -6,22 +6,18 @@ namespace TechTalk.SpecFlow.Reporting { - public class XmlResourceResolver : XmlResolver + public class XmlResourceResolver : XmlUrlResolver { - private ICredentials credentials; - public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) { + if (absoluteUri == null || !"resource".Equals(absoluteUri.Scheme, StringComparison.InvariantCultureIgnoreCase)) + return base.GetEntity(absoluteUri, role, ofObjectToReturn); + string resourceName = absoluteUri.AbsolutePath.TrimStart(Path.AltDirectorySeparatorChar).Replace(Path.AltDirectorySeparatorChar, Type.Delimiter); string assemblyName = absoluteUri.Host; Assembly assembly = Assembly.Load(assemblyName); return new ResourceXmlReader(assembly, resourceName); } - - public override ICredentials Credentials - { - set { credentials = value; } - } } } \ No newline at end of file diff --git a/Reporting/XsltHelper.cs b/Reporting/XsltHelper.cs index b4ce57683..db274ba34 100644 --- a/Reporting/XsltHelper.cs +++ b/Reporting/XsltHelper.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Linq; using System.Reflection; using System.Text; using System.Xml; @@ -27,19 +26,19 @@ public static void TransformXml(XmlSerializer serializer, object report, string } } - public static void TransformHtml(XmlSerializer serializer, object report, Type reportType, string outputFilePath, GeneratorConfiguration generatorConfiguration) + public static void TransformHtml(XmlSerializer serializer, object report, Type reportType, string outputFilePath, GeneratorConfiguration generatorConfiguration, string xsltFile) { var xmlOutputWriter = new StringWriter(); serializer.Serialize(xmlOutputWriter, report); XslCompiledTransform xslt = new XslCompiledTransform(); - var xsltSettings = new XsltSettings(true, false); - var resourceResolver = new XmlResourceResolver(); + XmlResolver resourceResolver; var reportName = reportType.Name.Replace("Generator", ""); - using (var xsltReader = new ResourceXmlReader(reportType, reportName + ".xslt")) + using (var xsltReader = GetTemplateReader(reportType, reportName, xsltFile)) { + resourceResolver = new XmlResourceResolver(); xslt.Load(xsltReader, xsltSettings, resourceResolver); } @@ -54,10 +53,16 @@ public static void TransformHtml(XmlSerializer serializer, object report, Type r } } - static public void Transform(this XslCompiledTransform xslt, XmlReader input, XsltArgumentList arguments, Stream results, XmlResolver documentResolver) + private static XmlReader GetTemplateReader(Type reportType, string reportName, string xsltFile) { - //xslt.command.Execute(input, new XmlUrlResolver(), arguments, results); + if (string.IsNullOrEmpty(xsltFile)) + return new ResourceXmlReader(reportType, reportName + ".xslt"); + + return new XmlTextReader(xsltFile); + } + private static void Transform(this XslCompiledTransform xslt, XmlReader input, XsltArgumentList arguments, Stream results, XmlResolver documentResolver) + { var command = xslt.GetType().GetField("command", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(xslt); var executeMethod = command.GetType().GetMethod("Execute", new Type[] { typeof(XmlReader), typeof(XmlResolver), typeof(XsltArgumentList), typeof(Stream) }); diff --git a/Runtime/Attributes.cs b/Runtime/Attributes.cs index daa61d07c..1218b6a6a 100644 --- a/Runtime/Attributes.cs +++ b/Runtime/Attributes.cs @@ -111,18 +111,30 @@ public AfterStepAttribute(params string[] tags) : base(BindingEvent.StepEnd, tag } [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] - public class StepTransformationAttribute : Attribute + public class StepArgumentTransformationAttribute : Attribute { public string Regex { get; set; } - public StepTransformationAttribute(string regex) + public StepArgumentTransformationAttribute(string regex) { Regex = regex; } - public StepTransformationAttribute() + public StepArgumentTransformationAttribute() { Regex = "(.*)"; } } + + [Obsolete("this attribute has been renamed to [StepArgumentTransformation]")] + public class StepTransformationAttribute : StepArgumentTransformationAttribute + { + public StepTransformationAttribute(string regex) : base(regex) + { + } + + public StepTransformationAttribute() + { + } + } } \ No newline at end of file diff --git a/Runtime/Bindings/BindingRegistry.cs b/Runtime/Bindings/BindingRegistry.cs index dc4de1dbc..e6be680e1 100644 --- a/Runtime/Bindings/BindingRegistry.cs +++ b/Runtime/Bindings/BindingRegistry.cs @@ -64,9 +64,9 @@ internal void BuildBindingsFromType(Type type) BuildEventBindingFromMethod(method, bindingEventAttr); } - var stepTransformationAttrs = Attribute.GetCustomAttributes(method, typeof(StepTransformationAttribute)); + var stepTransformationAttrs = Attribute.GetCustomAttributes(method, typeof(StepArgumentTransformationAttribute)); if (stepTransformationAttrs != null) - foreach (StepTransformationAttribute stepTransformationAttr in stepTransformationAttrs) + foreach (StepArgumentTransformationAttribute stepTransformationAttr in stepTransformationAttrs) { BuildStepTransformationFromMethod(method, stepTransformationAttr); } @@ -128,9 +128,9 @@ private void BuildStepBindingFromMethod(MethodInfo method, ScenarioStepAttribute stepBindings.Add(stepBinding); } - private void BuildStepTransformationFromMethod(MethodInfo method, StepTransformationAttribute transformationAttribute) + private void BuildStepTransformationFromMethod(MethodInfo method, StepArgumentTransformationAttribute argumentTransformationAttribute) { - StepTransformationBinding stepTransformationBinding = new StepTransformationBinding(transformationAttribute.Regex, method); + StepTransformationBinding stepTransformationBinding = new StepTransformationBinding(argumentTransformationAttribute.Regex, method); stepTransformations.Add(stepTransformationBinding); } diff --git a/Runtime/ScenarioContext.cs b/Runtime/ScenarioContext.cs index fb81d21ce..f9b60b86d 100644 --- a/Runtime/ScenarioContext.cs +++ b/Runtime/ScenarioContext.cs @@ -26,7 +26,7 @@ static public ScenarioContext Current public ScenarioBlock CurrentScenarioBlock { get; internal set; } internal TestStatus TestStatus { get; set; } - internal Exception TestError { get; set; } + public Exception TestError { get; internal set; } internal List PendingSteps { get; private set; } internal List MissingSteps { get; private set; } internal Stopwatch Stopwatch { get; private set; } diff --git a/TechTalk.SpecFlow.sln b/TechTalk.SpecFlow.sln index 648c807db..0347debaa 100644 --- a/TechTalk.SpecFlow.sln +++ b/TechTalk.SpecFlow.sln @@ -33,8 +33,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImportGherkinParser", "Inst EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FeatureTests", "Tests\FeatureTests\FeatureTests.csproj", "{3FE793A8-E662-4026-B4EC-891324073235}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ExternalStepsVB", "Tests\FeatureTests\ExternalSteps\ExternalStepsVB\ExternalStepsVB.vbproj", "{D3F6B835-B228-4DCF-B533-B6ED469A33B3}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExternalStepsCS", "Tests\FeatureTests\ExternalSteps\ExternalStepsCS\ExternalStepsCS.csproj", "{3836A6FC-4ECC-413A-AC8F-83A0A773EC9E}" EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SpecFlowInstaller", "Installer\SpecFlowInstaller\SpecFlowInstaller.wixproj", "{89167EB9-F458-48DA-9D8F-F639A74F5871}" @@ -47,6 +45,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Resources", "Resources", "{ Installer\Resources\welcome_dialog.bmp = Installer\Resources\welcome_dialog.bmp EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportingTests", "Tests\ReportingTests\ReportingTests.csproj", "{1965463E-6972-4618-8E59-D3259AE7A125}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportingTest.SampleProject", "Tests\ReportingTest.SampleProject\ReportingTest.SampleProject.csproj", "{E5C299D5-E7CC-4477-9A0B-4797B74BC88B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -155,16 +157,6 @@ Global {3FE793A8-E662-4026-B4EC-891324073235}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {3FE793A8-E662-4026-B4EC-891324073235}.Release|Mixed Platforms.Build.0 = Release|Any CPU {3FE793A8-E662-4026-B4EC-891324073235}.Release|x86.ActiveCfg = Release|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Debug|x86.ActiveCfg = Debug|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Release|Any CPU.Build.0 = Release|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {D3F6B835-B228-4DCF-B533-B6ED469A33B3}.Release|x86.ActiveCfg = Release|Any CPU {3836A6FC-4ECC-413A-AC8F-83A0A773EC9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3836A6FC-4ECC-413A-AC8F-83A0A773EC9E}.Debug|Any CPU.Build.0 = Debug|Any CPU {3836A6FC-4ECC-413A-AC8F-83A0A773EC9E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -185,6 +177,26 @@ Global {89167EB9-F458-48DA-9D8F-F639A74F5871}.Release|Mixed Platforms.Build.0 = Release|x86 {89167EB9-F458-48DA-9D8F-F639A74F5871}.Release|x86.ActiveCfg = Release|x86 {89167EB9-F458-48DA-9D8F-F639A74F5871}.Release|x86.Build.0 = Release|x86 + {1965463E-6972-4618-8E59-D3259AE7A125}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Debug|x86.ActiveCfg = Debug|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Release|Any CPU.Build.0 = Release|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {1965463E-6972-4618-8E59-D3259AE7A125}.Release|x86.ActiveCfg = Release|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Debug|x86.ActiveCfg = Debug|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Release|Any CPU.Build.0 = Release|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -196,7 +208,8 @@ Global {70376361-0BE1-478D-8EEC-47BD1C768165} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} {F8FACCF0-5497-4C6B-861F-78D72FD9561B} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} {3FE793A8-E662-4026-B4EC-891324073235} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} - {D3F6B835-B228-4DCF-B533-B6ED469A33B3} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} {3836A6FC-4ECC-413A-AC8F-83A0A773EC9E} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} + {1965463E-6972-4618-8E59-D3259AE7A125} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} EndGlobalSection EndGlobal diff --git a/Tests/FeatureTests/App.config b/Tests/FeatureTests/App.config index 6c026b5ed..3e4445223 100644 --- a/Tests/FeatureTests/App.config +++ b/Tests/FeatureTests/App.config @@ -22,7 +22,6 @@ /> - diff --git a/Tests/FeatureTests/ExternalSteps/ExternalSteps.feature b/Tests/FeatureTests/ExternalSteps/ExternalSteps.feature index f78ac1c99..9d39880a8 100644 --- a/Tests/FeatureTests/ExternalSteps/ExternalSteps.feature +++ b/Tests/FeatureTests/ExternalSteps/ExternalSteps.feature @@ -3,7 +3,7 @@ As a bdd enthusiast I want to use step definitions from other assemblies -Scenario: Steps defined in an external VB project and an external c-sharp project +Scenario: Steps defined in an external .NET (e.g. c# or VB.NET) Given I have external step definitions in a separate assembly referenced by this project When I call those steps Then the scenario should pass diff --git a/Tests/FeatureTests/ExternalSteps/ExternalSteps.feature.cs b/Tests/FeatureTests/ExternalSteps/ExternalSteps.feature.cs index 9b747e21d..85172f0d2 100644 --- a/Tests/FeatureTests/ExternalSteps/ExternalSteps.feature.cs +++ b/Tests/FeatureTests/ExternalSteps/ExternalSteps.feature.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------ // // This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.2.0.0 +// SpecFlow Version:1.3.0.0 // Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if @@ -14,7 +14,7 @@ namespace TechTalk.SpecFlow.FeatureTests.ExternalSteps using TechTalk.SpecFlow; - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.2.0.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.0.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("External Step Definitions")] @@ -30,7 +30,7 @@ public partial class ExternalStepDefinitionsFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en"), "External Step Definitions", "In order to modularize my solution\r\nAs a bdd enthusiast\r\nI want to use step defin" + + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "External Step Definitions", "In order to modularize my solution\r\nAs a bdd enthusiast\r\nI want to use step defin" + "itions from other assemblies", ((string[])(null))); testRunner.OnFeatureStart(featureInfo); } @@ -54,19 +54,19 @@ public virtual void ScenarioTearDown() } [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Steps defined in an external VB project and an external c-sharp project")] - public virtual void StepsDefinedInAnExternalVBProjectAndAnExternalC_SharpProject() + [NUnit.Framework.DescriptionAttribute("Steps defined in an external .NET (e.g. c# or VB.NET)")] + public virtual void StepsDefinedInAnExternal_NETE_G_COrVB_NET() { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Steps defined in an external VB project and an external c-sharp project", ((string[])(null))); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Steps defined in an external .NET (e.g. c# or VB.NET)", ((string[])(null))); #line 6 this.ScenarioSetup(scenarioInfo); #line 7 - testRunner.Given("I have external step definitions in a separate assembly referenced by this projec" + +testRunner.Given("I have external step definitions in a separate assembly referenced by this projec" + "t"); #line 8 - testRunner.When("I call those steps"); +testRunner.When("I call those steps"); #line 9 - testRunner.Then("the scenario should pass"); +testRunner.Then("the scenario should pass"); #line hidden testRunner.CollectScenarioErrors(); } diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsCS/CSSteps.cs b/Tests/FeatureTests/ExternalSteps/ExternalStepsCS/CSSteps.cs index 2ac2bf7af..a90752a04 100644 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsCS/CSSteps.cs +++ b/Tests/FeatureTests/ExternalSteps/ExternalStepsCS/CSSteps.cs @@ -10,6 +10,18 @@ namespace ExternalStepsCS [Binding] public class CSSteps { + [Given(@"I have external step definitions in a separate assembly referenced by this project")] + public void GivenIHaveExternalStepDefinitionsInASeparateAssemblyReferencedByThisProject() + { + ScenarioContext.Current["counter"] = 1; + } + + [When(@"I call those steps")] + public void WhenICallThoseSteps() + { + ScenarioContext.Current["counter"] = (int)ScenarioContext.Current["counter"] + 1; + } + [Then("the scenario should pass")] public void GivenAFeatureWhichRequiresADependentContext() { diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/ExternalStepsVB.vbproj b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/ExternalStepsVB.vbproj deleted file mode 100644 index 3b4b0fd39..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/ExternalStepsVB.vbproj +++ /dev/null @@ -1,113 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D3F6B835-B228-4DCF-B533-B6ED469A33B3} - Library - ExternalStepsVB - ExternalStepsVB - 512 - Windows - v3.5 - On - Binary - Off - On - - - true - full - true - true - bin\Debug\ - ExternalStepsVB.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - ExternalStepsVB.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - {413EE28C-4F89-4C6F-BA1E-2CDEE4CD43B4} - TechTalk.SpecFlow - - - - - \ No newline at end of file diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Application.Designer.vb b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Application.Designer.vb deleted file mode 100644 index d4e7c6707..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Application.Designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.4927 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Application.myapp b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Application.myapp deleted file mode 100644 index 758895def..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 1 - true - diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/AssemblyInfo.vb b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/AssemblyInfo.vb deleted file mode 100644 index c2414cd00..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Resources.Designer.vb b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Resources.Designer.vb deleted file mode 100644 index 80f727dc5..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.4927 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ' - ' A strongly-typed resource class, for looking up localized strings, etc. - ' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ' - ' Returns the cached ResourceManager instance used by this class. - ' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ExternalStepsVB.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ' - ' Overrides the current thread's CurrentUICulture property for all - ' resource lookups using this strongly typed resource class. - ' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Resources.resx b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Settings.Designer.vb b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Settings.Designer.vb deleted file mode 100644 index ac249979b..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.4927 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.ExternalStepsVB.My.MySettings - Get - Return Global.ExternalStepsVB.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Settings.settings b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Settings.settings deleted file mode 100644 index 85b890b3c..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/VBSteps.vb b/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/VBSteps.vb deleted file mode 100644 index ee30ea4dc..000000000 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsVB/VBSteps.vb +++ /dev/null @@ -1,16 +0,0 @@ -Imports TechTalk.SpecFlow - - _ -Public Class VBStepDefinitions - - _ - Public Sub step1() - ScenarioContext.Current.Item("counter") = 1 - End Sub - - <[When]("I call those steps")> _ - Public Sub step2() - ScenarioContext.Current.Item("counter") += 1 - End Sub - -End Class diff --git a/Tests/FeatureTests/FeatureTests.csproj b/Tests/FeatureTests/FeatureTests.csproj index 170388ebe..3a7a9fa79 100644 --- a/Tests/FeatureTests/FeatureTests.csproj +++ b/Tests/FeatureTests/FeatureTests.csproj @@ -117,10 +117,6 @@ {3836A6FC-4ECC-413A-AC8F-83A0A773EC9E} ExternalStepsCS - - {D3F6B835-B228-4DCF-B533-B6ED469A33B3} - ExternalStepsVB - diff --git a/Tests/FeatureTests/StepArgumentTransfomation/StepArgumentTransformationSteps.cs b/Tests/FeatureTests/StepArgumentTransfomation/StepArgumentTransformationSteps.cs index 845b7f444..a4a8f7841 100644 --- a/Tests/FeatureTests/StepArgumentTransfomation/StepArgumentTransformationSteps.cs +++ b/Tests/FeatureTests/StepArgumentTransfomation/StepArgumentTransformationSteps.cs @@ -15,7 +15,7 @@ public class Terminal [Binding] public class UserLookup { - [StepTransformation] + [StepArgumentTransformation] public User Transform(string name) { return new User {Name = name}; @@ -25,7 +25,7 @@ public User Transform(string name) [Binding] public class DateConverter { - [StepTransformation("date (.*)")] + [StepArgumentTransformation("date (.*)")] public DateTime Transform(string dateString) { return DateTime.Parse(dateString); @@ -35,7 +35,7 @@ public DateTime Transform(string dateString) [Binding] public class TerminalConverter { - [StepTransformation("terminal (.*)")] + [StepArgumentTransformation("terminal (.*)")] public Terminal Transform(string terminalId) { return new Terminal { Id = terminalId }; diff --git a/Tests/ParserTests/SuccessfulGenerationTest.cs b/Tests/ParserTests/SuccessfulGenerationTest.cs index fe82050e7..59d4db070 100644 --- a/Tests/ParserTests/SuccessfulGenerationTest.cs +++ b/Tests/ParserTests/SuccessfulGenerationTest.cs @@ -134,7 +134,7 @@ public void CanGenerateFromFile(string fileName) SpecFlowLangParser parser = new SpecFlowLangParser(new CultureInfo("en-US")); using (var reader = new StreamReader(fileName)) { - Feature feature = parser.Parse(reader); + Feature feature = parser.Parse(reader, null); Assert.IsNotNull(feature); string generatedCode = GenerateCodeFromFeature(feature); diff --git a/Tests/ParserTests/SuccessfulMbUnitGenerationTest.cs b/Tests/ParserTests/SuccessfulMbUnitGenerationTest.cs index ec2a39577..f9dd9c866 100644 --- a/Tests/ParserTests/SuccessfulMbUnitGenerationTest.cs +++ b/Tests/ParserTests/SuccessfulMbUnitGenerationTest.cs @@ -81,7 +81,7 @@ public void CanGenerateFromFile(string fileName) var parser = new SpecFlowLangParser(new CultureInfo("en-US")); using (var reader = new StreamReader(fileName)) { - Feature feature = parser.Parse(reader); + Feature feature = parser.Parse(reader, null); Assert.IsNotNull(feature); string generatedCode = GenerateCodeFromFeature(feature); diff --git a/Tests/ParserTests/SuccessfulParsingTest.cs b/Tests/ParserTests/SuccessfulParsingTest.cs index b84b6001b..402a04bbe 100644 --- a/Tests/ParserTests/SuccessfulParsingTest.cs +++ b/Tests/ParserTests/SuccessfulParsingTest.cs @@ -36,6 +36,13 @@ public void CanParseGermanFeature() CanParseFile(Path.Combine(folder, "german.feature")); } + [Test] + public void CanParseHungarianFeature() + { + var folder = Path.GetFullPath(Path.Combine(TestFileHelper.GetProjectLocation(), "TestFiles")); + CanParseFile(Path.Combine(folder, "hungarian.feature")); + } + [Test] public void CanParseSwedishFeature() { @@ -141,8 +148,11 @@ public void CanParseFile(string fileName) SpecFlowLangParser parser = new SpecFlowLangParser(new CultureInfo("en-US")); using (var reader = new StreamReader(fileName)) { - Feature feature = parser.Parse(reader); + Feature feature = parser.Parse(reader, fileName); Assert.IsNotNull(feature); + Assert.AreEqual(fileName, feature.SourceFile); + + feature.SourceFile = null; // cleanup source file to make the test run from other folders too // to regenerate the expected result file: //SerializeFeature(feature, fileName + ".xml"); diff --git a/Tests/ParserTests/SuccessfulXUnitGenerationTest.cs b/Tests/ParserTests/SuccessfulXUnitGenerationTest.cs index e3f313b97..d00d31c65 100644 --- a/Tests/ParserTests/SuccessfulXUnitGenerationTest.cs +++ b/Tests/ParserTests/SuccessfulXUnitGenerationTest.cs @@ -134,7 +134,7 @@ public void CanGenerateFromFile(string fileName) SpecFlowLangParser parser = new SpecFlowLangParser(new CultureInfo("en-US")); using (var reader = new StreamReader(fileName)) { - Feature feature = parser.Parse(reader); + Feature feature = parser.Parse(reader, null); Assert.IsNotNull(feature); string generatedCode = GenerateCodeFromFeature(feature); diff --git a/Tests/ParserTests/TestFiles/hungarian.feature b/Tests/ParserTests/TestFiles/hungarian.feature index cdbcfe478..2f99c6ce2 100644 --- a/Tests/ParserTests/TestFiles/hungarian.feature +++ b/Tests/ParserTests/TestFiles/hungarian.feature @@ -5,7 +5,7 @@ Jellemző: Összeadás két szám összegét szeretném kiszámoltatni. Forgatókönyv vázlat: Két szám összeadása - Ha beütök a számológépbe egy -est + Amennyiben beütök a számológépbe egy -est És beütök a számológépbe egy -est Majd megnyomom az gombot Akkor eredményül -t kell kapnom diff --git a/Tests/ReportingTest.SampleProject/App.config b/Tests/ReportingTest.SampleProject/App.config new file mode 100644 index 000000000..175aabc02 --- /dev/null +++ b/Tests/ReportingTest.SampleProject/App.config @@ -0,0 +1,10 @@ + + + +
+ + + + + + \ No newline at end of file diff --git a/Tests/ReportingTest.SampleProject/FeatureWithFailingScenarios.feature b/Tests/ReportingTest.SampleProject/FeatureWithFailingScenarios.feature new file mode 100644 index 000000000..8f31732cf --- /dev/null +++ b/Tests/ReportingTest.SampleProject/FeatureWithFailingScenarios.feature @@ -0,0 +1,14 @@ +Feature: Feature with failing scenarios + In order to test reporting + As a SpecFlow developer + I want to have a feature that has failing scenarios + +@ignore +Scenario: Ignored scenario + Given I have a precondition that is successful + +Scenario: Scenario with pending steps + Given I have a pending precondition + +Scenario: Scenario with failing steps + Given I have a precondition that is failing diff --git a/Tests/ReportingTest.SampleProject/FeatureWithSuccessfulScenarios.feature b/Tests/ReportingTest.SampleProject/FeatureWithSuccessfulScenarios.feature new file mode 100644 index 000000000..1dbe816cd --- /dev/null +++ b/Tests/ReportingTest.SampleProject/FeatureWithSuccessfulScenarios.feature @@ -0,0 +1,15 @@ +Feature: Feature with successful scenarios + In order to test reporting + As a SpecFlow developer + I want to have a feature that has successful scenarios + +Scenario: First successful scenario + Given I have a precondition that is successful + When I do something that works + Then I have a postcondition that is successful + +Scenario: Second successful scenario + Given I have a precondition that is successful + And I have a precondition that is successful + When I do something that works + Then I have a postcondition that is successful diff --git a/Tests/ReportingTest.SampleProject/NUnitResult/generate.cmd b/Tests/ReportingTest.SampleProject/NUnitResult/generate.cmd new file mode 100644 index 000000000..d8833705f --- /dev/null +++ b/Tests/ReportingTest.SampleProject/NUnitResult/generate.cmd @@ -0,0 +1,6 @@ + +pushd %~dp0\.. + +..\..\lib\nunit\nunit-console.exe bin\Debug\ReportingTest.SampleProject.dll /labels /xml=NUnitResult\TestResult.xml /out:NUnitResult\TestResult.txt /err:NUnitResult\TestResult.err + +popd \ No newline at end of file diff --git a/Tests/ReportingTest.SampleProject/Properties/AssemblyInfo.cs b/Tests/ReportingTest.SampleProject/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..81cac99ca --- /dev/null +++ b/Tests/ReportingTest.SampleProject/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ReportingTest.SampleProject")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("ReportingTest.SampleProject")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("72c7aff1-9d5f-4975-9396-294c8d4ced33")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj b/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj new file mode 100644 index 000000000..57e209d7b --- /dev/null +++ b/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj @@ -0,0 +1,82 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B} + Library + Properties + ReportingTest.SampleProject + ReportingTest.SampleProject + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {413EE28C-4F89-4C6F-BA1E-2CDEE4CD43B4} + TechTalk.SpecFlow + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/ReportingTest.SampleProject/StepDefinitions.cs b/Tests/ReportingTest.SampleProject/StepDefinitions.cs new file mode 100644 index 000000000..256cfd15a --- /dev/null +++ b/Tests/ReportingTest.SampleProject/StepDefinitions.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TechTalk.SpecFlow; +using NUnit.Framework; + +namespace ReportingTest.SampleProject +{ + [Binding] + public class StepDefinitions + { + [Given(@"I have a precondition that is (.*)")] + [When(@"I do something that (.*)")] + [Then(@"I have a postcondition that is (.*)")] + public void GivenIHaveAPreconditionThatIs(string result) + { + switch(result.ToLower()) + { + case "successful": + case "works": + return; + case "failing": + Assert.Fail("simulated failure"); + break; + case "pending": + ScenarioContext.Current.Pending(); + break; + default: + Assert.Fail("unknown result"); + break; + } + } + } +} diff --git a/Tests/ReportingTest.SampleProject/readme.txt b/Tests/ReportingTest.SampleProject/readme.txt new file mode 100644 index 000000000..b238899a5 --- /dev/null +++ b/Tests/ReportingTest.SampleProject/readme.txt @@ -0,0 +1,11 @@ +This project is not a test project for SpecFlow, but a sample specflow test +project that is used for testing the reporting. + +The unit tests generated by SpecFlow are disabled, to avoid execution and +fake error reports for SpecFlow. + +Enable the sample tests: +- set the "Custom Tool" property of the feature file nodes to "SpecFlowSingleFileGenerator" + +Disable the sample tests: +- set the "Custom Tool" property of the feature file nodes to empty diff --git a/Tests/ReportingTests/CustomXsltTemplate.feature b/Tests/ReportingTests/CustomXsltTemplate.feature new file mode 100644 index 000000000..fbfb8cb7d --- /dev/null +++ b/Tests/ReportingTests/CustomXsltTemplate.feature @@ -0,0 +1,104 @@ +Feature: Using custom XSLT template for reports + In order to customize the look of the specflow reports + As a test manager + I want to be able to specify a custom XSLT template for the report generation + +Scenario: Specfiy custom XSLT for NUnit execution report + Given there are NUuit test execution results for the ReportingTest.SampleProject project + And there is an XSLT template containing + """ + + features: + all: + success: + failure: + pending: + ignored: + + """ + When I generate SpecFlow NUnit execution report with the custom XSLT + Then a report generated like + """ + features: 2 + all: 5 + success: 2 + failure: 1 + pending: 1 + ignored: 1 + """ + +Scenario: Custom XSLT can include other custom XSLT + Given there are NUuit test execution results for the ReportingTest.SampleProject project + And there is an XSLT template 'custominclude.xslt' containing + """ + + this was generated by a custom template + features: + + """ + And there is an XSLT template containing + """ + + + + + + """ + When I generate SpecFlow NUnit execution report with the custom XSLT + Then a report generated like + """ + this was generated by a custom template + features: 2 + """ + + +Scenario: Custom XSLT can include built-in SpecFlow XSLT + Given there are NUuit test execution results for the ReportingTest.SampleProject project + And there is an XSLT template containing + """ + + + + the english tool text for 'GeneratedByPre' is + + + + + """ + When I generate SpecFlow NUnit execution report with the custom XSLT + Then a report generated like + """ + the english tool text for 'GeneratedByPre' is + Generated by SpecFlow at + """ + +Scenario: Custom XSLT can include built-in SpecFlow and custom XSLT + Given there are NUuit test execution results for the ReportingTest.SampleProject project + And there is an XSLT template 'custominclude.xslt' containing + """ + + this was generated by a custom template + features: + + """ + And there is an XSLT template containing + """ + + + + + the english tool text for 'GeneratedByPre' is + + + + + + """ + When I generate SpecFlow NUnit execution report with the custom XSLT + Then a report generated like + """ + the english tool text for 'GeneratedByPre' is + Generated by SpecFlow at + this was generated by a custom template + features: 2 + """ diff --git a/Tests/ReportingTests/CustomXsltTemplate.feature.cs b/Tests/ReportingTests/CustomXsltTemplate.feature.cs new file mode 100644 index 000000000..7b8d8f5c3 --- /dev/null +++ b/Tests/ReportingTests/CustomXsltTemplate.feature.cs @@ -0,0 +1,180 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.3.0.0 +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +namespace ReportingTests +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.0.0")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Using custom XSLT template for reports")] + public partial class UsingCustomXSLTTemplateForReportsFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "CustomXsltTemplate.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Using custom XSLT template for reports", "In order to customize the look of the specflow reports\r\nAs a test manager\r\nI want" + + " to be able to specify a custom XSLT template for the report generation", ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Specfiy custom XSLT for NUnit execution report")] + public virtual void SpecfiyCustomXSLTForNUnitExecutionReport() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Specfiy custom XSLT for NUnit execution report", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line hidden +#line 8 +testRunner.And("there is an XSLT template containing", @" + features: + all: + success: + failure: + pending: + ignored: + ", ((TechTalk.SpecFlow.Table)(null))); +#line 19 +testRunner.When("I generate SpecFlow NUnit execution report with the custom XSLT"); +#line hidden +#line 20 +testRunner.Then("a report generated like", "\tfeatures: 2\r\n\tall: 5\r\n\tsuccess: 2\r\n\tfailure: 1\r\n\tpending: 1\r\n\tignored: 1", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Custom XSLT can include other custom XSLT")] + public virtual void CustomXSLTCanIncludeOtherCustomXSLT() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Custom XSLT can include other custom XSLT", ((string[])(null))); +#line 30 +this.ScenarioSetup(scenarioInfo); +#line 31 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line hidden +#line 32 +testRunner.And("there is an XSLT template \'custominclude.xslt\' containing", " \r\n\tthis was generated by a custom template" + + "\r\n\tfeatures: \r\n \t", ((TechTalk.SpecFlow.Table)(null))); +#line hidden +#line 39 +testRunner.And("there is an XSLT template containing", " \r\n \r\n \r\n\t\r\n \t", ((TechTalk.SpecFlow.Table)(null))); +#line 47 +testRunner.When("I generate SpecFlow NUnit execution report with the custom XSLT"); +#line hidden +#line 48 +testRunner.Then("a report generated like", "\tthis was generated by a custom template\r\n\tfeatures: 2", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Custom XSLT can include built-in SpecFlow XSLT")] + public virtual void CustomXSLTCanIncludeBuilt_InSpecFlowXSLT() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Custom XSLT can include built-in SpecFlow XSLT", ((string[])(null))); +#line 55 +this.ScenarioSetup(scenarioInfo); +#line 56 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line hidden +#line 57 +testRunner.And("there is an XSLT template containing", @" + + + the english tool text for 'GeneratedByPre' is + + + + ", ((TechTalk.SpecFlow.Table)(null))); +#line 68 +testRunner.When("I generate SpecFlow NUnit execution report with the custom XSLT"); +#line hidden +#line 69 +testRunner.Then("a report generated like", "\tthe english tool text for \'GeneratedByPre\' is\r\n\tGenerated by SpecFlow at ", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Custom XSLT can include built-in SpecFlow and custom XSLT")] + public virtual void CustomXSLTCanIncludeBuilt_InSpecFlowAndCustomXSLT() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Custom XSLT can include built-in SpecFlow and custom XSLT", ((string[])(null))); +#line 75 +this.ScenarioSetup(scenarioInfo); +#line 76 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line hidden +#line 77 +testRunner.And("there is an XSLT template \'custominclude.xslt\' containing", " \r\n\tthis was generated by a custom template" + + "\r\n\tfeatures: \r\n \t", ((TechTalk.SpecFlow.Table)(null))); +#line hidden +#line 84 +testRunner.And("there is an XSLT template containing", @" + + + + the english tool text for 'GeneratedByPre' is + + + + + ", ((TechTalk.SpecFlow.Table)(null))); +#line 97 +testRunner.When("I generate SpecFlow NUnit execution report with the custom XSLT"); +#line hidden +#line 98 +testRunner.Then("a report generated like", "\tthe english tool text for \'GeneratedByPre\' is\r\n\tGenerated by SpecFlow at \r\n\tthis" + + " was generated by a custom template\r\n\tfeatures: 2", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + } +} +#endregion diff --git a/Tests/ReportingTests/Properties/AssemblyInfo.cs b/Tests/ReportingTests/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5a5f0efc1 --- /dev/null +++ b/Tests/ReportingTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ReportingTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("ReportingTests")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8ad80bf4-df2e-4190-8119-db4704ee8875")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/ReportingTests/ReportingTests.csproj b/Tests/ReportingTests/ReportingTests.csproj new file mode 100644 index 000000000..6fdfe7291 --- /dev/null +++ b/Tests/ReportingTests/ReportingTests.csproj @@ -0,0 +1,93 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {1965463E-6972-4618-8E59-D3259AE7A125} + Library + Properties + ReportingTests + ReportingTests + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + True + True + CustomXsltTemplate.feature + + + + + + + + {FC43509F-E7D3-40C4-B4C3-1E6C9D5530A4} + TechTalk.SpecFlow.Reporting + + + {413EE28C-4F89-4C6F-BA1E-2CDEE4CD43B4} + TechTalk.SpecFlow + + + {87BE7FE6-C3DE-4409-ABF6-FA5B60AF3DE1} + TechTalk.SpecFlow.Tools + + + {E5C299D5-E7CC-4477-9A0B-4797B74BC88B} + ReportingTest.SampleProject + + + + + SpecFlowSingleFileGenerator + CustomXsltTemplate.feature.cs + + + + + \ No newline at end of file diff --git a/Tests/ReportingTests/StepDefinitions/Setup.cs b/Tests/ReportingTests/StepDefinitions/Setup.cs new file mode 100644 index 000000000..66ab6241b --- /dev/null +++ b/Tests/ReportingTests/StepDefinitions/Setup.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using NUnit.Framework; +using TechTalk.SpecFlow; + +namespace ReportingTests.StepDefinitions +{ + [Binding] + public class Setup + { + [BeforeScenario] + public void BeforeScenario() + { + //ScenarioContext.Current["project"] + } + } + + public class SampleProjectInfo : IDisposable + { + public string ProjectFolder { get; private set; } + public string NUnitXmlResultPath { get; private set; } + public string NUnitTextResultPath { get; private set; } + public string CustomXslt { get; set; } + + public string OutputFilePath { get; private set; } + + public string ProjectFilePath { get; private set; } + + public SampleProjectInfo() + { + ProjectFolder = Path.GetFullPath( + Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"..\..\..\ReportingTest.SampleProject")); + ProjectFilePath = Path.Combine(ProjectFolder, @"ReportingTest.SampleProject.csproj"); + + NUnitXmlResultPath = Path.Combine(ProjectFolder, @"NUnitResult\TestResult.xml"); + NUnitTextResultPath = Path.Combine(ProjectFolder, @"NUnitResult\TestResult.txt"); + + OutputFilePath = GenerateTempFilePath(".html"); + } + + public string GenerateFilePath(string fileName) + { + return Path.Combine(Path.GetTempPath(), fileName); + } + + public string GenerateTempFilePath(string extension) + { + return Path.Combine(Path.GetTempPath(), Path.GetTempFileName()) + extension; + } + + public void Dispose() + { + if (CustomXslt != null) + File.Delete(CustomXslt); + } + + public string GetOutputFileContent() + { + Assert.IsTrue(File.Exists(OutputFilePath), "output file is missing"); + + using (var reader = new StreamReader(OutputFilePath)) + { + return reader.ReadToEnd(); + } + } + } +} diff --git a/Tests/ReportingTests/StepDefinitions/StepDefinitions.cs b/Tests/ReportingTests/StepDefinitions/StepDefinitions.cs new file mode 100644 index 000000000..d7cc95fe5 --- /dev/null +++ b/Tests/ReportingTests/StepDefinitions/StepDefinitions.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using TechTalk.SpecFlow; +using NUnit.Framework; +using SpecFlowTool = TechTalk.SpecFlow.Tools.Program; + +namespace ReportingTests.StepDefinitions +{ + [Binding] + public class StepDefinitions + { + private SampleProjectInfo sampleProjectInfo; + + public StepDefinitions(SampleProjectInfo sampleProjectInfo) + { + this.sampleProjectInfo = sampleProjectInfo; + } + + [Given(@"there are NUuit test execution results for the ReportingTest.SampleProject project")] + public void GivenThereIsAnNUuitTestExecutionResultsForMyProject() + { + Assert.IsTrue(File.Exists(sampleProjectInfo.NUnitXmlResultPath), "NUnit xml test result is missing"); + Assert.IsTrue(File.Exists(sampleProjectInfo.NUnitTextResultPath), "NUnit txt test result is missing"); + } + + [Given(@"there is an XSLT template containing")] + public void GivenThereIsAnXSLTTemplateContaining(string xsltContent) + { + sampleProjectInfo.CustomXslt = GenerateCustomXslt(xsltContent, null); + } + + [Given(@"there is an XSLT template '(.*)' containing")] + public void GivenThereIsAnXSLTTemplateContaining(string templateFileName, string xsltContent) + { + GenerateCustomXslt(xsltContent, templateFileName); + } + + [When(@"I generate SpecFlow NUnit execution report with the custom XSLT")] + public void WhenIGenerateSpecFlowNUnitExecutionReportWithTheCustomXSLT() + { + SpecFlowTool.NUnitExecutionReport( + sampleProjectInfo.ProjectFilePath, + sampleProjectInfo.NUnitXmlResultPath, + sampleProjectInfo.CustomXslt, + sampleProjectInfo.NUnitTextResultPath, + sampleProjectInfo.OutputFilePath); + } + + [Then(@"a report generated like")] + public void ThenAReportGeneratedLike(string expectedResultContent) + { + Assert.IsTrue(File.Exists(sampleProjectInfo.OutputFilePath), "no result is generated"); + + string resultContent = sampleProjectInfo.GetOutputFileContent(); + + AssertEqualIgnoringWhitespace(expectedResultContent, resultContent); + } + + private void AssertEqualIgnoringWhitespace(string expectedValue, string actualValue) + { + StringAssert.AreEqualIgnoringCase(NormalizeWhitespace(expectedValue), NormalizeWhitespace(actualValue)); + } + + private string NormalizeWhitespace(string value) + { + var whitespaceRe = new Regex(@"\s+"); + return whitespaceRe.Replace(value.Trim(), " "); + } + + private string GenerateCustomXslt(string content, string templateFileName) + { + string xsltTemplate = @" + + + +{0} + + +"; + + string fullContent = string.Format(xsltTemplate, content); + + string path = templateFileName == null + ? sampleProjectInfo.GenerateTempFilePath(".xslt") + : sampleProjectInfo.GenerateFilePath(templateFileName); + using (TextWriter writer = new StreamWriter(path, false, Encoding.UTF8)) + { + writer.WriteLine(fullContent); + } + + return path; + } + } +} \ No newline at end of file diff --git a/Tests/RuntimeTests/BindingRegistryTest.cs b/Tests/RuntimeTests/BindingRegistryTest.cs index 1d1db55c1..bc9a6b410 100644 --- a/Tests/RuntimeTests/BindingRegistryTest.cs +++ b/Tests/RuntimeTests/BindingRegistryTest.cs @@ -13,7 +13,7 @@ public class BindingRegistryTests [Binding] public class StepTransformationExample { - [StepTransformation("BindingRegistryTests")] + [StepArgumentTransformation("BindingRegistryTests")] public int Transform(string val) { return 42; diff --git a/Tests/RuntimeTests/ExecutionTestBase.cs b/Tests/RuntimeTests/ExecutionTestBase.cs index 66117a40b..6a6c76e25 100644 --- a/Tests/RuntimeTests/ExecutionTestBase.cs +++ b/Tests/RuntimeTests/ExecutionTestBase.cs @@ -153,7 +153,7 @@ public void CanGenerateFromFile(string fileName) SpecFlowLangParser parser = new SpecFlowLangParser(new CultureInfo("en-US")); using (var reader = new StreamReader(fileName)) { - Feature feature = parser.Parse(reader); + Feature feature = parser.Parse(reader, null); Assert.IsNotNull(feature); ExecuteTests(feature, fileName); diff --git a/Tests/RuntimeTests/StepTransformationTests.cs b/Tests/RuntimeTests/StepTransformationTests.cs index d71b3b3b3..dd5c2550c 100644 --- a/Tests/RuntimeTests/StepTransformationTests.cs +++ b/Tests/RuntimeTests/StepTransformationTests.cs @@ -13,7 +13,7 @@ public class User [Binding] public class UserCreator { - [StepTransformation("user (w+)")] + [StepArgumentTransformation("user (w+)")] public User Create(string name) { return new User {Name = name}; diff --git a/Tools/Program.cs b/Tools/Program.cs index eab82b21b..31ce9a6c7 100644 --- a/Tools/Program.cs +++ b/Tools/Program.cs @@ -5,10 +5,11 @@ using TechTalk.SpecFlow.Generator.Configuration; using TechTalk.SpecFlow.Reporting.NUnitExecutionReport; using TechTalk.SpecFlow.Reporting.StepDefinitionReport; +using MsBuildProjectReader = TechTalk.SpecFlow.Generator.Configuration.MsBuildProjectReader; namespace TechTalk.SpecFlow.Tools { - internal class Program + public class Program { private static void Main(string[] args) { @@ -32,27 +33,29 @@ public static void GenerateAll( [Action("Generates a report about usage and binding of steps")] public static void StepDefinitionReport( [Required(Description = "Visual Studio Project File containing specs")] string projectFile, + [Optional("", Description = "Xslt file to use, defaults to built-in stylesheet if not provided")] string xsltFile, [Optional("bin\\Debug", Description = @"Path for Spec dll e.g. Company.Specs.dll. Defaults to bin\Debug ")] string binFolder, [Optional("StepDefinitionReport.html", "out", Description = "Generated Output File. Defaults to StepDefinitionReport.html")] string outputFile) { - var generator = new StepDefinitionReportGenerator(projectFile, binFolder, true); - generator.GenerateReport(); - generator.TransformReport(Path.GetFullPath(outputFile)); + StepDefinitionReportParameters reportParameters = + new StepDefinitionReportParameters(projectFile, outputFile, xsltFile, binFolder, true); + var generator = new StepDefinitionReportGenerator(reportParameters); + generator.GenerateAndTransformReport(); } [Action("Formats an NUnit execution report to SpecFlow style")] public static void NUnitExecutionReport([Required(Description = "Visual Studio Project File containing specs")] string projectFile, [Optional("TestResult.xml", Description = "Xml Test Result file generated by NUnit. Defaults to TestResult.xml")] string xmlTestResult, + [Optional("", Description = "Xslt file to use, defaults to built-in stylesheet if not provided")] string xsltFile, [Optional("TestResult.txt", "testOutput")] string labeledTestOutput, [Optional("TestResult.html", "out", Description = "Generated Output File. Defaults to TestResult.html")] string outputFile) { - var generator = new NUnitExecutionReportGenerator(projectFile, Path.GetFullPath(xmlTestResult), - Path.GetFullPath(labeledTestOutput)); - - generator.GenerateReport(); - generator.TransformReport(Path.GetFullPath(outputFile)); + NUnitExecutionReportParameters reportParameters = + new NUnitExecutionReportParameters(projectFile, xmlTestResult, labeledTestOutput, outputFile, xsltFile); + var generator = new NUnitExecutionReportGenerator(reportParameters); + generator.GenerateAndTransformReport(); } - + #endregion } } \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 4719a62f4..c89815eea 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,18 @@ +1.3.1 - ??? + +New features: ++ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.0.1 ++ Custom XSLT can be specified for generating reports. + See examples in Tests/ReportingTests/CustomXsltTemplate.feature ++ The test error can be accessed through ScenarioContext.Current.TestError + (e.g. in an AfterScenario event). ++ [StepTransformation] attribute has been renamed to [StepArgumentTransformation] + because this name describe the intention better. Using the old attribute will + generate a warning. + +Fixed issues: ++ NullReference exception when using BeforeTestRun event (Issue 41) + 1.3.0 - 2010/05/05 New features: diff --git a/lib/gherkin/Gherkin.dll b/lib/gherkin/Gherkin.dll index 0ae5c722d..045322970 100644 Binary files a/lib/gherkin/Gherkin.dll and b/lib/gherkin/Gherkin.dll differ diff --git a/lib/gherkin/Gherkin.pdb b/lib/gherkin/Gherkin.pdb index bde81784a..d56bbbbef 100644 Binary files a/lib/gherkin/Gherkin.pdb and b/lib/gherkin/Gherkin.pdb differ diff --git a/lib/gherkin/gherkin-1.0.24.dll b/lib/gherkin/gherkin-1.0.24.dll deleted file mode 100644 index 0c56d9b52..000000000 Binary files a/lib/gherkin/gherkin-1.0.24.dll and /dev/null differ diff --git a/lib/gherkin/gherkin-2.0.1.dll b/lib/gherkin/gherkin-2.0.1.dll new file mode 100644 index 000000000..3810086cb Binary files /dev/null and b/lib/gherkin/gherkin-2.0.1.dll differ diff --git a/lib/nunit/nunit-console-runner.dll b/lib/nunit/nunit-console-runner.dll new file mode 100644 index 000000000..c74073598 Binary files /dev/null and b/lib/nunit/nunit-console-runner.dll differ diff --git a/lib/nunit/nunit-console.exe b/lib/nunit/nunit-console.exe new file mode 100644 index 000000000..87651672a Binary files /dev/null and b/lib/nunit/nunit-console.exe differ diff --git a/lib/nunit/nunit-console.exe.config b/lib/nunit/nunit-console.exe.config new file mode 100644 index 000000000..f32f92bcb --- /dev/null +++ b/lib/nunit/nunit-console.exe.config @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/nunit/nunit.core.dll b/lib/nunit/nunit.core.dll new file mode 100644 index 000000000..c51d8ff24 Binary files /dev/null and b/lib/nunit/nunit.core.dll differ diff --git a/lib/nunit/nunit.core.interfaces.dll b/lib/nunit/nunit.core.interfaces.dll new file mode 100644 index 000000000..607ddeed1 Binary files /dev/null and b/lib/nunit/nunit.core.interfaces.dll differ diff --git a/lib/nunit/nunit.framework.dll b/lib/nunit/nunit.framework.dll index 1c87f11bd..07e4c6eae 100644 Binary files a/lib/nunit/nunit.framework.dll and b/lib/nunit/nunit.framework.dll differ diff --git a/lib/nunit/nunit.framework.xml b/lib/nunit/nunit.framework.xml new file mode 100644 index 000000000..b678714c9 --- /dev/null +++ b/lib/nunit/nunit.framework.xml @@ -0,0 +1,10113 @@ + + + + nunit.framework + + + + + BinaryConstraint is the abstract base of all constraints + that combine two other constraints in some fashion. + + + + + The Constraint class is the base of all built-in constraints + within NUnit. It provides the operator overloads used to combine + constraints. + + + + + The IConstraintExpression interface is implemented by all + complete and resolvable constraints and expressions. + + + + + Return the top-level constraint for this expression + + + + + + Static UnsetObject used to detect derived constraints + failing to set the actual value. + + + + + The actual value being tested against a constraint + + + + + The display name of this Constraint for use by ToString() + + + + + Argument fields used by ToString(); + + + + + The builder holding this constraint + + + + + Construct a constraint with no arguments + + + + + Construct a constraint with one argument + + + + + Construct a constraint with two arguments + + + + + Sets the ConstraintBuilder holding this constraint + + + + + Write the failure message to the MessageWriter provided + as an argument. The default implementation simply passes + the constraint and the actual value to the writer, which + then displays the constraint description and the value. + + Constraints that need to provide additional details, + such as where the error occured can override this. + + The MessageWriter on which to display the message + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Test whether the constraint is satisfied by an + ActualValueDelegate that returns the value to be tested. + The default implementation simply evaluates the delegate + but derived classes may override it to provide for delayed + processing. + + An ActualValueDelegate + True for success, false for failure + + + + Test whether the constraint is satisfied by a given reference. + The default implementation simply dereferences the value but + derived classes may override it to provide for delayed processing. + + A reference to the value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Default override of ToString returns the constraint DisplayName + followed by any arguments within angle brackets. + + + + + + This operator creates a constraint that is satisfied only if both + argument constraints are satisfied. + + + + + This operator creates a constraint that is satisfied if either + of the argument constraints is satisfied. + + + + + This operator creates a constraint that is satisfied if the + argument constraint is not satisfied. + + + + + Returns a DelayedConstraint with the specified delay time. + + The delay in milliseconds. + + + + + Returns a DelayedConstraint with the specified delay time + and polling interval. + + The delay in milliseconds. + The interval at which to test the constraint. + + + + + The display name of this Constraint for use by ToString(). + The default value is the name of the constraint with + trailing "Constraint" removed. Derived classes may set + this to another name in their constructors. + + + + + Returns a ConstraintExpression by appending And + to the current constraint. + + + + + Returns a ConstraintExpression by appending And + to the current constraint. + + + + + Returns a ConstraintExpression by appending Or + to the current constraint. + + + + + Class used to detect any derived constraints + that fail to set the actual value in their + Matches override. + + + + + The first constraint being combined + + + + + The second constraint being combined + + + + + Construct a BinaryConstraint from two other constraints + + The first constraint + The second constraint + + + + AndConstraint succeeds only if both members succeed. + + + + + Create an AndConstraint from two other constraints + + The first constraint + The second constraint + + + + Apply both member constraints to an actual value, succeeding + succeeding only if both of them succeed. + + The actual value + True if the constraints both succeeded + + + + Write a description for this contraint to a MessageWriter + + The MessageWriter to receive the description + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + OrConstraint succeeds if either member succeeds + + + + + Create an OrConstraint from two other constraints + + The first constraint + The second constraint + + + + Apply the member constraints to an actual value, succeeding + succeeding as soon as one of them succeeds. + + The actual value + True if either constraint succeeded + + + + Write a description for this contraint to a MessageWriter + + The MessageWriter to receive the description + + + + CollectionConstraint is the abstract base class for + constraints that operate on collections. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Determines whether the specified enumerable is empty. + + The enumerable. + + true if the specified enumerable is empty; otherwise, false. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Protected method to be implemented by derived classes + + + + + + + CollectionItemsEqualConstraint is the abstract base class for all + collection constraints that apply some notion of item equality + as a part of their operation. + + + + + Construct an empty CollectionConstraint + + + + + Construct a CollectionConstraint + + + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Compares two collection members for equality + + + + + Return a new CollectionTally for use in making tests + + The collection to be included in the tally + + + + Flag the constraint to ignore case and return self. + + + + + CollectionTally counts (tallies) the number of + occurences of each object in one or more enumerations. + + + + + Construct a CollectionTally object from a comparer and a collection + + + + + Try to remove an object from the tally + + The object to remove + True if successful, false if the object was not found + + + + Try to remove a set of objects from the tally + + The objects to remove + True if successful, false if any object was not found + + + + The number of objects remaining in the tally + + + + + EmptyCollectionConstraint tests whether a collection is empty. + + + + + Check that the collection is empty + + + + + + + Write the constraint description to a MessageWriter + + + + + + UniqueItemsConstraint tests whether all the items in a + collection are unique. + + + + + Check that all items are unique. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionContainsConstraint is used to test whether a collection + contains an expected object as a member. + + + + + Construct a CollectionContainsConstraint + + + + + + Test whether the expected item is contained in the collection + + + + + + + Write a descripton of the constraint to a MessageWriter + + + + + + CollectionEquivalentCOnstraint is used to determine whether two + collections are equivalent. + + + + + Construct a CollectionEquivalentConstraint + + + + + + Test whether two collections are equivalent + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionSubsetConstraint is used to determine whether + one collection is a subset of another + + + + + Construct a CollectionSubsetConstraint + + The collection that the actual value is expected to be a subset of + + + + Test whether the actual collection is a subset of + the expected collection provided. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + CollectionOrderedConstraint is used to test whether a collection is ordered. + + + + + Construct a CollectionOrderedConstraint + + + + + Modifies the constraint to use an IComparer and returns self. + + + + + Modifies the constraint to use an IComparer<T> and returns self. + + + + + Modifies the constraint to use a Comparison<T> and returns self. + + + + + Modifies the constraint to test ordering by the value of + a specified property and returns self. + + + + + Test whether the collection is ordered + + + + + + + Write a description of the constraint to a MessageWriter + + + + + + Returns the string representation of the constraint. + + + + + + If used performs a reverse comparison + + + + + Abstract base class for constraints that compare values to + determine if one is greater than, equal to or less than + the other. + + + + + The value against which a comparison is to be made + + + + + If true, less than returns success + + + + + if true, equal returns success + + + + + if true, greater than returns success + + + + + The predicate used as a part of the description + + + + + ComparisonAdapter to be used in making the comparison + + + + + Initializes a new instance of the class. + + The value against which to make a comparison. + if set to true less succeeds. + if set to true equal succeeds. + if set to true greater succeeds. + String used in describing the constraint. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Modifies the constraint to use an IComparer and returns self + + + + + Modifies the constraint to use an IComparer<T> and returns self + + + + + Modifies the constraint to use a Comparison<T> and returns self + + + + + Tests whether a value is greater than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is greater than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is less than the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Tests whether a value is less than or equal to the value supplied to its constructor + + + + + Initializes a new instance of the class. + + The expected value. + + + + Delegate used to delay evaluation of the actual value + to be used in evaluating a constraint + + + + + ConstraintBuilder maintains the stacks that are used in + processing a ConstraintExpression. An OperatorStack + is used to hold operators that are waiting for their + operands to be reognized. a ConstraintStack holds + input constraints as well as the results of each + operator applied. + + + + + Initializes a new instance of the class. + + + + + Appends the specified operator to the expression by first + reducing the operator stack and then pushing the new + operator on the stack. + + The operator to push. + + + + Appends the specified constraint to the expresson by pushing + it on the constraint stack. + + The constraint to push. + + + + Sets the top operator right context. + + The right context. + + + + Reduces the operator stack until the topmost item + precedence is greater than or equal to the target precedence. + + The target precedence. + + + + Resolves this instance, returning a Constraint. If the builder + is not currently in a resolvable state, an exception is thrown. + + The resolved constraint + + + + Gets a value indicating whether this instance is resolvable. + + + true if this instance is resolvable; otherwise, false. + + + + + OperatorStack is a type-safe stack for holding ConstraintOperators + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified operator onto the stack. + + The op. + + + + Pops the topmost operator from the stack. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost operator without modifying the stack. + + The top. + + + + ConstraintStack is a type-safe stack for holding Constraints + + + + + Initializes a new instance of the class. + + The builder. + + + + Pushes the specified constraint. As a side effect, + the constraint's builder field is set to the + ConstraintBuilder owning this stack. + + The constraint. + + + + Pops this topmost constrait from the stack. + As a side effect, the constraint's builder + field is set to null. + + + + + + Gets a value indicating whether this is empty. + + true if empty; otherwise, false. + + + + Gets the topmost constraint without modifying the stack. + + The topmost constraint + + + + EmptyConstraint tests a whether a string or collection is empty, + postponing the decision about which test is applied until the + type of the actual argument is known. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EqualConstraint is able to compare an actual value with the + expected value provided in its constructor. Two objects are + considered equal if both are null, or if both have the same + value. NUnit has special semantics for some object types. + + + + + If true, strings in error messages will be clipped + + + + + NUnitEqualityComparer used to test equality. + + + + + Initializes a new instance of the class. + + The expected value. + + + + Flag the constraint to use a tolerance when determining equality. + + Tolerance value to be used + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied Comparison object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Flag the constraint to use the supplied IEqualityComparer object. + + The IComparer object to use. + Self. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write a failure message. Overridden to provide custom + failure messages for EqualConstraint. + + The MessageWriter to write to + + + + Write description of this constraint + + The MessageWriter to write to + + + + Display the failure information for two collections that did not match. + + The MessageWriter on which to display + The expected collection. + The actual collection + The depth of this failure in a set of nested collections + + + + Displays a single line showing the types and sizes of the expected + and actual collections or arrays. If both are identical, the value is + only shown once. + + The MessageWriter on which to display + The expected collection or array + The actual collection or array + The indentation level for the message line + + + + Displays a single line showing the point in the expected and actual + arrays at which the comparison failed. If the arrays have different + structures or dimensions, both values are shown. + + The MessageWriter on which to display + The expected array + The actual array + Index of the failure point in the underlying collections + The indentation level for the message line + + + + Flag the constraint to ignore case and return self. + + + + + Flag the constraint to suppress string clipping + and return self. + + + + + Flag the constraint to compare arrays as collections + and return self. + + + + + Switches the .Within() modifier to interpret its tolerance as + a distance in representable values (see remarks). + + Self. + + Ulp stands for "unit in the last place" and describes the minimum + amount a given value can change. For any integers, an ulp is 1 whole + digit. For floating point values, the accuracy of which is better + for smaller numbers and worse for larger numbers, an ulp depends + on the size of the number. Using ulps for comparison of floating + point results instead of fixed tolerances is safer because it will + automatically compensate for the added inaccuracy of larger numbers. + + + + + Switches the .Within() modifier to interpret its tolerance as + a percentage that the actual values is allowed to deviate from + the expected value. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in days. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in hours. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in minutes. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in seconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in milliseconds. + + Self + + + + Causes the tolerance to be interpreted as a TimeSpan in clock ticks. + + Self + + + + SameAsConstraint tests whether an object is identical to + the object passed to its constructor + + + + + Initializes a new instance of the class. + + The expected object. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + StringConstraint is the abstract base for constraints + that operate on strings. It supports the IgnoreCase + modifier for string operations. + + + + + The expected value + + + + + Indicates whether tests should be case-insensitive + + + + + Constructs a StringConstraint given an expected value + + The expected value + + + + Modify the constraint to ignore case in matching. + + + + + EmptyStringConstraint tests whether a string is empty. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + NullEmptyStringConstraint tests whether a string is either null or empty. + + + + + Constructs a new NullOrEmptyStringConstraint + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SubstringConstraint can test whether a string contains + the expected substring. + + + + + Initializes a new instance of the class. + + The expected. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + StartsWithConstraint can test whether a string starts + with an expected substring. + + + + + Initializes a new instance of the class. + + The expected string + + + + Test whether the constraint is matched by the actual value. + This is a template method, which calls the IsMatch method + of the derived class. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EndsWithConstraint can test whether a string ends + with an expected substring. + + + + + Initializes a new instance of the class. + + The expected string + + + + Test whether the constraint is matched by the actual value. + This is a template method, which calls the IsMatch method + of the derived class. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + RegexConstraint can test whether a string matches + the pattern provided. + + + + + Initializes a new instance of the class. + + The pattern. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + TypeConstraint is the abstract base for constraints + that take a Type as their expected value. + + + + + The expected Type used by the constraint + + + + + Construct a TypeConstraint for a given Type + + + + + + Write the actual value for a failing constraint test to a + MessageWriter. TypeConstraints override this method to write + the name of the type. + + The writer on which the actual value is displayed + + + + ExactTypeConstraint is used to test that an object + is of the exact type provided in the constructor + + + + + Construct an ExactTypeConstraint for a given Type + + The expected Type. + + + + Test that an object is of the exact type specified + + The actual value. + True if the tested object is of the exact type provided, otherwise false. + + + + Write the description of this constraint to a MessageWriter + + The MessageWriter to use + + + + InstanceOfTypeConstraint is used to test that an object + is of the same type provided or derived from it. + + + + + Construct an InstanceOfTypeConstraint for the type provided + + The expected Type + + + + Test whether an object is of the specified type or a derived type + + The object to be tested + True if the object is of the provided type or derives from it, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + AssignableFromConstraint is used to test that an object + can be assigned from a given Type. + + + + + Construct an AssignableFromConstraint for the type provided + + + + + + Test whether an object can be assigned from the specified type + + The object to be tested + True if the object can be assigned a value of the expected Type, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + AssignableToConstraint is used to test that an object + can be assigned to a given Type. + + + + + Construct an AssignableToConstraint for the type provided + + + + + + Test whether an object can be assigned to the specified type + + The object to be tested + True if the object can be assigned a value of the expected Type, otherwise false. + + + + Write a description of this constraint to a MessageWriter + + The MessageWriter to use + + + + ContainsConstraint tests a whether a string contains a substring + or a collection contains an object. It postpones the decision of + which test to use until the type of the actual argument is known. + This allows testing whether a string is contained in a collection + or as a substring of another string using the same syntax. + + + + + Initializes a new instance of the class. + + The expected. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Flag the constraint to ignore case and return self. + + + + + PropertyExistsConstraint tests that a named property + exists on the object provided through Match. + + Originally, PropertyConstraint provided this feature + in addition to making optional tests on the vaue + of the property. The two constraints are now separate. + + + + + Initializes a new instance of the class. + + The name of the property. + + + + Test whether the property exists for a given object + + The object to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + + PropertyConstraint extracts a named property and uses + its value as the actual value for a chained constraint. + + + + + Abstract base class used for prefixes + + + + + The base constraint + + + + + Construct given a base constraint + + + + + + Initializes a new instance of the class. + + The name. + The constraint to apply to the property. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + + + NotConstraint negates the effect of some other constraint + + + + + Initializes a new instance of the class. + + The base constraint to be negated. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for if the base constraint fails, false if it succeeds + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a MessageWriter. + + The writer on which the actual value is displayed + + + + AllItemsConstraint applies another constraint to each + item in a collection, succeeding if they all succeed. + + + + + Construct an AllItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + SomeItemsConstraint applies another constraint to each + item in a collection, succeeding if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + succeeding if any item succeeds. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + NoItemConstraint applies another constraint to each + item in a collection, failing if any of them succeeds. + + + + + Construct a SomeItemsConstraint on top of an existing constraint + + + + + + Apply the item constraint to each item in the collection, + failing if any item fails. + + + + + + + Write a description of this constraint to a MessageWriter + + + + + + The Numerics class contains common operations on numeric values. + + + + + Checks the type of the object, returning true if + the object is a numeric type. + + The object to check + true if the object is a numeric type + + + + Checks the type of the object, returning true if + the object is a floating point numeric type. + + The object to check + true if the object is a floating point numeric type + + + + Checks the type of the object, returning true if + the object is a fixed point numeric type. + + The object to check + true if the object is a fixed point numeric type + + + + Test two numeric values for equality, performing the usual numeric + conversions and using a provided or default tolerance. If the tolerance + provided is Empty, this method may set it to a default tolerance. + + The expected value + The actual value + A reference to the tolerance in effect + True if the values are equal + + + + Compare two numeric values, performing the usual numeric conversions. + + The expected value + The actual value + The relationship of the values to each other + + + + MessageWriter is the abstract base for classes that write + constraint descriptions and messages in some form. The + class has separate methods for writing various components + of a message, allowing implementations to tailor the + presentation as needed. + + + + + Construct a MessageWriter given a culture + + + + + Method to write single line message with optional args, usually + written to precede the general failure message. + + The message to be written + Any arguments used in formatting the message + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a givel + indentation level. + + The indentation level of the message + The message to be written + Any arguments used in formatting the message + + + + Display Expected and Actual lines for a constraint. This + is called by MessageWriter's default implementation of + WriteMessageTo and provides the generic two-line display. + + The constraint that failed + + + + Display Expected and Actual lines for given values. This + method may be called by constraints that need more control over + the display of actual and expected values than is provided + by the default implementation. + + The expected value + The actual value causing the failure + + + + Display Expected and Actual lines for given values, including + a tolerance value on the Expected line. + + The expected value + The actual value causing the failure + The tolerance within which the test was made + + + + Display the expected and actual string values on separate lines. + If the mismatch parameter is >=0, an additional line is displayed + line containing a caret that points to the mismatch point. + + The expected string value + The actual string value + The point at which the strings don't match or -1 + If true, case is ignored in locating the point where the strings differ + If true, the strings should be clipped to fit the line + + + + Writes the text for a connector. + + The connector. + + + + Writes the text for a predicate. + + The predicate. + + + + Writes the text for an expected value. + + The expected value. + + + + Writes the text for a modifier + + The modifier. + + + + Writes the text for an actual value. + + The actual value. + + + + Writes the text for a generalized value. + + The value. + + + + Writes the text for a collection value, + starting at a particular point, to a max length + + The collection containing elements to write. + The starting point of the elements to write + The maximum number of elements to write + + + + Abstract method to get the max line length + + + + + Static methods used in creating messages + + + + + Static string used when strings are clipped + + + + + Returns the representation of a type as used in NUnitLite. + This is the same as Type.ToString() except for arrays, + which are displayed with their declared sizes. + + + + + + + Converts any control characters in a string + to their escaped representation. + + The string to be converted + The converted string + + + + Return the a string representation for a set of indices into an array + + Array of indices for which a string is needed + + + + Get an array of indices representing the point in a collection or + array corresponding to a single int index into the collection. + + The collection to which the indices apply + Index in the collection + Array of indices + + + + Clip a string to a given length, starting at a particular offset, returning the clipped + string with ellipses representing the removed parts + + The string to be clipped + The maximum permitted length of the result string + The point at which to start clipping + The clipped string + + + + Clip the expected and actual strings in a coordinated fashion, + so that they may be displayed together. + + + + + + + + + Shows the position two strings start to differ. Comparison + starts at the start index. + + The expected string + The actual string + The index in the strings at which comparison should start + Boolean indicating whether case should be ignored + -1 if no mismatch found, or the index where mismatch found + + + + PathConstraint serves as the abstract base of constraints + that operate on paths and provides several helper methods. + + + + + The expected path used in the constraint + + + + + Flag indicating whether a caseInsensitive comparison should be made + + + + + Construct a PathConstraint for a give expected path + + The expected path + + + + Returns the string representation of this constraint + + + + + Canonicalize the provided path + + + The path in standardized form + + + + Test whether two paths are the same + + The first path + The second path + + + + + Test whether one path is the same as or under another path + + The first path - supposed to be the parent path + The second path - supposed to be the child path + + + + + Modifies the current instance to be case-insensitve + and returns it. + + + + + Modifies the current instance to be case-sensitve + and returns it. + + + + + Summary description for SamePathConstraint. + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + SamePathOrUnderConstraint tests that one path is under another + + + + + Initializes a new instance of the class. + + The expected path + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + EmptyDirectoryConstraint is used to test that a directory is empty + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + SubDirectoryConstraint is used to test that one directory is a subdirectory of another. + + + + + Initializes a new instance of the class. + + The dir info. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Builds a list of DirectoryInfo objects, recursing where necessary + + directory to recurse + list of DirectoryInfo objects from the top level + + + + private method to determine whether a directory is within the path + + top-level directory to search + directory to search for + true if found, false if not + + + + Method to compare two DirectoryInfo objects + + first directory to compare + second directory to compare + true if equivalent, false if not + + + + ThrowsConstraint is used to test the exception thrown by + a delegate by applying a constraint to it. + + + + + Initializes a new instance of the class, + using a constraint to be applied to the exception. + + A constraint to apply to the caught exception. + + + + Executes the code of the delegate and captures any exception. + If a non-null base constraint was provided, it applies that + constraint to the exception. + + A delegate representing the code to be tested + True if an exception is thrown and the constraint succeeds, otherwise false + + + + Converts an ActualValueDelegate to a TestDelegate + before calling the primary overload. + + + + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of this constraint + + + + + Get the actual exception thrown - used by Assert.Throws. + + + + + ThrowsNothingConstraint tests that a delegate does not + throw an exception. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True if no exception is thrown, otherwise false + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + RangeConstraint tests whethe two values are within a + specified range. + + + + + Initializes a new instance of the class. + + From. + To. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Modifies the constraint to use an IComparer and returns self. + + + + + Modifies the constraint to use an IComparer<T> and returns self. + + + + + Modifies the constraint to use a Comparison<T> and returns self. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The ConstraintOperator class is used internally by a + ConstraintBuilder to represent an operator that + modifies or combines constraints. + + Constraint operators use left and right precedence + values to determine whether the top operator on the + stack should be reduced before pushing a new operator. + + + + + The precedence value used when the operator + is about to be pushed to the stack. + + + + + The precedence value used when the operator + is on the top of the stack. + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + The syntax element preceding this operator + + + + + The syntax element folowing this operator + + + + + The precedence value used when the operator + is about to be pushed to the stack. + + + + + The precedence value used when the operator + is on the top of the stack. + + + + + PrefixOperator takes a single constraint and modifies + it's action in some way. + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Returns the constraint created by applying this + prefix to another constraint. + + + + + + + Negates the test of the constraint it wraps. + + + + + Constructs a new NotOperator + + + + + Returns a NotConstraint applied to its argument. + + + + + Abstract base for operators that indicate how to + apply a constraint to items in a collection. + + + + + Constructs a CollectionOperator + + + + + Represents a constraint that succeeds if all the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + they all succeed. + + + + + Represents a constraint that succeeds if any of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + any of them succeed. + + + + + Represents a constraint that succeeds if none of the + members of a collection match a base constraint. + + + + + Returns a constraint that will apply the argument + to the members of a collection, succeeding if + none of them succeed. + + + + + Represents a constraint that simply wraps the + constraint provided as an argument, without any + further functionality, but which modifes the + order of evaluation because of its precedence. + + + + + Constructor for the WithOperator + + + + + Returns a constraint that wraps its argument + + + + + Abstract base class for operators that are able to reduce to a + constraint whether or not another syntactic element follows. + + + + + Operator used to test for the presence of a named Property + on an object and optionally apply further tests to the + value of that property. + + + + + Constructs a PropOperator for a particular named property + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Gets the name of the property to which the operator applies + + + + + Operator that tests for the presence of a particular attribute + on a type and optionally applies further tests to the attribute. + + + + + Construct an AttributeOperator for a particular Type + + The Type of attribute tested + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Operator that tests that an exception is thrown and + optionally applies further tests to the exception. + + + + + Construct a ThrowsOperator + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + Abstract base class for all binary operators + + + + + Reduce produces a constraint from the operator and + any arguments. It takes the arguments from the constraint + stack and pushes the resulting constraint on it. + + + + + + Abstract method that produces a constraint by applying + the operator to its left and right constraint arguments. + + + + + Gets the left precedence of the operator + + + + + Gets the right precedence of the operator + + + + + Operator that requires both it's arguments to succeed + + + + + Construct an AndOperator + + + + + Apply the operator to produce an AndConstraint + + + + + Operator that requires at least one of it's arguments to succeed + + + + + Construct an OrOperator + + + + + Apply the operator to produce an OrConstraint + + + + + ConstraintExpression represents a compound constraint in the + process of being constructed from a series of syntactic elements. + + Individual elements are appended to the expression as they are + reognized. Once an actual Constraint is appended, the expression + returns a resolvable Constraint. + + + + + ConstraintExpressionBase is the abstract base class for the + generated ConstraintExpression class, which represents a + compound constraint in the process of being constructed + from a series of syntactic elements. + + NOTE: ConstraintExpressionBase is aware of some of its + derived classes, which is an apparent violation of + encapsulation. Ideally, these classes would be a + single class, but they must be separated in order to + allow parts to be generated under .NET 1.x and to + provide proper user feedback in syntactically + aware IDEs. + + + + + The ConstraintBuilder holding the elements recognized so far + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a string representation of the expression as it + currently stands. This should only be used for testing, + since it has the side-effect of resolving the expression. + + + + + + Appends an operator to the expression and returns the + resulting expression itself. + + + + + Appends a self-resolving operator to the expression and + returns a new ResolvableConstraintExpression. + + + + + Appends a constraint to the expression and returns that + constraint, which is associated with the current state + of the expression being built. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the + class passing in a ConstraintBuilder, which may be pre-populated. + + The builder. + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns the constraint provided as an argument - used to allow custom + custom constraints to easily participate in the syntax. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a new ContainsConstraint. This constraint + will, in turn, make use of the appropriate second-level + constraint, depending on the type of the actual argument. + This overload is only used if the item sought is a string, + since any other type implies that we are looking for a + collection member. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + With is currently a NOP - reserved for future use. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation + + + + + BinarySerializableConstraint tests whether + an object is serializable in binary format. + + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a + MessageWriter. The default implementation simply writes + the raw value of actual, leaving it to the writer to + perform any formatting. + + The writer on which the actual value is displayed + + + + Returns the string representation of this constraint + + + + + BasicConstraint is the abstract base for constraints that + perform a simple comparison to a constant value. + + + + + Initializes a new instance of the class. + + The expected. + The description. + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + NullConstraint tests that the actual value is null + + + + + Initializes a new instance of the class. + + + + + TrueConstraint tests that the actual value is true + + + + + Initializes a new instance of the class. + + + + + FalseConstraint tests that the actual value is false + + + + + Initializes a new instance of the class. + + + + + NaNConstraint tests that the actual value is a double or float NaN + + + + + Test that the actual value is an NaN + + + + + + + Write the constraint description to a specified writer + + + + + + AttributeExistsConstraint tests for the presence of a + specified attribute on a Type. + + + + + Constructs an AttributeExistsConstraint for a specific attribute Type + + + + + + Tests whether the object provides the expected attribute. + + A Type, MethodInfo, or other ICustomAttributeProvider + True if the expected attribute is present, otherwise false + + + + Writes the description of the constraint to the specified writer + + + + + AttributeConstraint tests that a specified attribute is present + on a Type or other provider and that the value of the attribute + satisfies some other constraint. + + + + + Constructs an AttributeConstraint for a specified attriute + Type and base constraint. + + + + + + + Determines whether the Type or other provider has the + expected attribute and if its value matches the + additional constraint specified. + + + + + Writes a description of the attribute to the specified writer. + + + + + Writes the actual value supplied to the specified writer. + + + + + Returns a string representation of the constraint. + + + + + ResolvableConstraintExpression is used to represent a compound + constraint being constructed at a point where the last operator + may either terminate the expression or may have additional + qualifying constraints added to it. + + It is used, for example, for a Property element or for + an Exception element, either of which may be optionally + followed by constraints that apply to the property or + exception. + + + + + Create a new instance of ResolvableConstraintExpression + + + + + Create a new instance of ResolvableConstraintExpression, + passing in a pre-populated ConstraintBuilder. + + + + + Resolve the current expression to a Constraint + + + + + Appends an And Operator to the expression + + + + + Appends an Or operator to the expression. + + + + + Applies a delay to the match so that a match can be evaluated in the future. + + + + + Creates a new DelayedConstraint + + The inner constraint two decorate + The time interval after which the match is performed + If the value of is less than 0 + + + + Creates a new DelayedConstraint + + The inner constraint two decorate + The time interval after which the match is performed + The time interval used for polling + If the value of is less than 0 + + + + Test whether the constraint is satisfied by a given value + + The value to be tested + True for if the base constraint fails, false if it succeeds + + + + Test whether the constraint is satisfied by a delegate + + The delegate whose value is to be tested + True for if the base constraint fails, false if it succeeds + + + + Test whether the constraint is satisfied by a given reference. + Overridden to wait for the specified delay period before + calling the base constraint with the dereferenced value. + + A reference to the value to be tested + True for success, false for failure + + + + Write the constraint description to a MessageWriter + + The writer on which the description is displayed + + + + Write the actual value for a failing constraint test to a MessageWriter. + + The writer on which the actual value is displayed + + + + Returns the string representation of the constraint. + + + + Helper routines for working with floating point numbers + + + The floating point comparison code is based on this excellent article: + http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm + + + "ULP" means Unit in the Last Place and in the context of this library refers to + the distance between two adjacent floating point numbers. IEEE floating point + numbers can only represent a finite subset of natural numbers, with greater + accuracy for smaller numbers and lower accuracy for very large numbers. + + + If a comparison is allowed "2 ulps" of deviation, that means the values are + allowed to deviate by up to 2 adjacent floating point values, which might be + as low as 0.0000001 for small numbers or as high as 10.0 for large numbers. + + + + + Compares two floating point values for equality + First floating point value to be compared + Second floating point value t be compared + + Maximum number of representable floating point values that are allowed to + be between the left and the right floating point values + + True if both numbers are equal or close to being equal + + + Floating point values can only represent a finite subset of natural numbers. + For example, the values 2.00000000 and 2.00000024 can be stored in a float, + but nothing inbetween them. + + + This comparison will count how many possible floating point values are between + the left and the right number. If the number of possible values between both + numbers is less than or equal to maxUlps, then the numbers are considered as + being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + Compares two double precision floating point values for equality + First double precision floating point value to be compared + Second double precision floating point value t be compared + + Maximum number of representable double precision floating point values that are + allowed to be between the left and the right double precision floating point values + + True if both numbers are equal or close to being equal + + + Double precision floating point values can only represent a limited series of + natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004 + can be stored in a double, but nothing inbetween them. + + + This comparison will count how many possible double precision floating point + values are between the left and the right number. If the number of possible + values between both numbers is less than or equal to maxUlps, then the numbers + are considered as being equal. + + + Implementation partially follows the code outlined here: + http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ + + + + + + Reinterprets the memory contents of a floating point value as an integer value + + + Floating point value whose memory contents to reinterpret + + + The memory contents of the floating point value interpreted as an integer + + + + + Reinterprets the memory contents of a double precision floating point + value as an integer value + + + Double precision floating point value whose memory contents to reinterpret + + + The memory contents of the double precision floating point value + interpreted as an integer + + + + + Reinterprets the memory contents of an integer as a floating point value + + Integer value whose memory contents to reinterpret + + The memory contents of the integer value interpreted as a floating point value + + + + + Reinterprets the memory contents of an integer value as a double precision + floating point value + + Integer whose memory contents to reinterpret + + The memory contents of the integer interpreted as a double precision + floating point value + + + + Union of a floating point variable and an integer + + + The union's value as a floating point variable + + + The union's value as an integer + + + The union's value as an unsigned integer + + + Union of a double precision floating point variable and a long + + + The union's value as a double precision floating point variable + + + The union's value as a long + + + The union's value as an unsigned long + + + + Modes in which the tolerance value for a comparison can + be interpreted. + + + + + The tolerance was created with a value, without specifying + how the value would be used. This is used to prevent setting + the mode more than once and is generally changed to Linear + upon execution of the test. + + + + + The tolerance is used as a numeric range within which + two compared values are considered to be equal. + + + + + Interprets the tolerance as the percentage by which + the two compared values my deviate from each other. + + + + + Compares two values based in their distance in + representable numbers. + + + + + The Tolerance class generalizes the notion of a tolerance + within which an equality test succeeds. Normally, it is + used with numeric types, but it can be used with any + type that supports taking a difference between two + objects and comparing that difference to a value. + + + + + Constructs a linear tolerance of a specdified amount + + + + + Constructs a tolerance given an amount and ToleranceMode + + + + + Tests that the current Tolerance is linear with a + numeric value, throwing an exception if it is not. + + + + + Returns an empty Tolerance object, equivalent to + specifying an exact match. + + + + + Gets the ToleranceMode for the current Tolerance + + + + + Gets the value of the current Tolerance instance. + + + + + Returns a new tolerance, using the current amount as a percentage. + + + + + Returns a new tolerance, using the current amount in Ulps. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of days. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of hours. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of minutes. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of seconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of milliseconds. + + + + + Returns a new tolerance with a TimeSpan as the amount, using + the current amount as a number of clock ticks. + + + + + Returns true if the current tolerance is empty. + + + + + ComparisonAdapter class centralizes all comparisons of + values in NUnit, adapting to the use of any provided + IComparer, IComparer<T> or Comparison<T> + + + + + Returns a ComparisonAdapter that wraps an IComparer + + + + + Returns a ComparisonAdapter that wraps an IComparer<T> + + + + + Returns a ComparisonAdapter that wraps a Comparison<T> + + + + + Compares two objects + + + + + Gets the default ComparisonAdapter, which wraps an + NUnitComparer object. + + + + + Construct a ComparisonAdapter for an IComparer + + + + + Compares two objects + + + + + + + + Construct a default ComparisonAdapter + + + + + ComparisonAdapter<T> extends ComparisonAdapter and + allows use of an IComparer<T> or Comparison<T> + to actually perform the comparison. + + + + + Construct a ComparisonAdapter for an IComparer<T> + + + + + Compare a Type T to an object + + + + + Construct a ComparisonAdapter for a Comparison<T> + + + + + Compare a Type T to an object + + + + + EqualityAdapter class handles all equality comparisons + that use an IEqualityComparer, IEqualityComparer<T> + or a ComparisonAdapter. + + + + + Compares two objects, returning true if they are equal + + + + + Returns an EqualityAdapter that wraps an IComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer. + + + + + Returns an EqualityAdapter that wraps an IEqualityComparer<T>. + + + + + Returns an EqualityAdapter that wraps an IComparer<T>. + + + + + Returns an EqualityAdapter that wraps a Comparison<T>. + + + + + NUnitComparer encapsulates NUnit's default behavior + in comparing two objects. + + + + + Compares two objects + + + + + + + + Returns the default NUnitComparer. + + + + + NUnitEqualityComparer encapsulates NUnit's handling of + equality tests between objects. + + + + + If true, all string comparisons will ignore case + + + + + If true, arrays will be treated as collections, allowing + those of different dimensions to be compared + + + + + If non-zero, equality comparisons within the specified + tolerance will succeed. + + + + + Comparison object used in comparisons for some constraints. + + + + + Compares two objects for equality. + + + + + Helper method to compare two arrays + + + + + Method to compare two DirectoryInfo objects + + first directory to compare + second directory to compare + true if equivalent, false if not + + + + Returns the default NUnitEqualityComparer + + + + + Gets and sets a flag indicating whether case should + be ignored in determining equality. + + + + + Gets and sets a flag indicating that arrays should be + compared as collections, without regard to their shape. + + + + + Gets and sets an external comparer to be used to + test for equality. It is applied to members of + collections, in place of NUnit's own logic. + + + + + Gets and sets a tolerance used to compare objects of + certin types. + + + + + Gets the list of failure points for the last Match performed. + + + + + Predicate constraint wraps a Predicate in a constraint, + returning success if the predicate is true. + + + + + Construct a PredicateConstraint from a predicate + + + + + Determines whether the predicate succeeds when applied + to the actual value. + + + + + Writes the description to a MessageWriter + + + + + SetUpFixtureAttribute is used to identify a SetUpFixture + + + + + Basic Asserts on strings. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string is not found within another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string is found within another string. + + The expected string + The string to be examined + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string starts with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not start with another string. + + The expected string + The string to be examined + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string ends with another string. + + The expected string + The string to be examined + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + The message to display in case of failure + + + + Asserts that a string does not end with another string. + + The expected string + The string to be examined + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are equal, without regard to case. + + The expected string + The actual string + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that two strings are Notequal, without regard to case. + + The expected string + The actual string + The message to display in case of failure + + + + Asserts that two strings are not equal, without regard to case. + + The expected string + The actual string + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + The message to display in case of failure + + + + Asserts that a string matches an expected regular expression pattern. + + The regex pattern to be matched + The actual string + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + Arguments used in formatting the message + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + The message to display in case of failure + + + + Asserts that a string does not match an expected regular expression pattern. + + The regex pattern to be used + The actual string + + + + PropertyAttribute is used to attach information to a test as a name/value pair.. + + + + + Construct a PropertyAttribute with a name and string value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and int value + + The name of the property + The property value + + + + Construct a PropertyAttribute with a name and double value + + The name of the property + The property value + + + + Constructor for derived classes that set the + property dictionary directly. + + + + + Constructor for use by derived classes that use the + name of the type as the property name. Derived classes + must ensure that the Type of the property value is + a standard type supported by the BCL. Any custom + types will cause a serialization Exception when + in the client. + + + + + Gets the property dictionary for this attribute + + + + + A set of Assert methods operationg on one or more collections + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + The message that will be displayed on failure + + + + Asserts that all items contained in collection are of the type specified by expectedType. + + IEnumerable containing objects to be considered + System.Type that all objects in collection must be instances of + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable containing objects to be considered + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable containing objects to be considered + The message that will be displayed on failure + + + + Asserts that all items contained in collection are not equal to null. + + IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Ensures that every object contained in collection exists within the collection + once and only once. + + IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are exactly equal. The collections must have the same count, + and contain the exact same objects in the same order. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + + + + Asserts that expected and actual are not exactly equal. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not exactly equal. + If comparer is not null then it will be used to compare the objects. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The IComparer to use in comparing objects from each IEnumerable + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + + + + Asserts that expected and actual are not equivalent. + + The first IEnumerable of objects to be considered + The second IEnumerable of objects to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + The message that will be displayed on failure + + + + Asserts that collection contains actual as an item. + + IEnumerable of objects to be considered + Object to be found within collection + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + The message that will be displayed on failure + + + + Asserts that collection does not contain actual as an item. + + IEnumerable of objects to be considered + Object that cannot exist within collection + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + + + + Asserts that superset is not a subject of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + + + + Asserts that superset is a subset of subset. + + The IEnumerable superset to be considered + The IEnumerable subset to be considered + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array,list or other collection is empty + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array,list or other collection is empty + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + The message to be displayed on failure + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + The message to be displayed on failure + Arguments to be used in formatting the message + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + The message to be displayed on failure + + + + Assert that an array, list or other collection is ordered + + An array, list or other collection implementing IEnumerable + A custom comparer to perform the comparisons + + + + Summary description for FileAssert. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + The message to display if objects are not equal + + + + Verifies that two Streams are equal. Two Streams are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The expected Stream + The actual Stream + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if objects are not equal + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A file containing the value that is expected + A file containing the actual value + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if objects are not equal + + + + Verifies that two files are equal. Two files are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + The message to be displayed when the two Stream are the same. + Arguments to be used in formatting the message + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + The message to be displayed when the Streams are the same. + + + + Asserts that two Streams are not equal. If they are equal + an is thrown. + + The expected Stream + The actual Stream + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + The message to display if objects are not equal + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + A file containing the value that is expected + A file containing the actual value + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if Streams are not equal + Arguments to be used in formatting the message + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + The message to display if objects are not equal + + + + Asserts that two files are not equal. If they are equal + an is thrown. + + The path to a file containing the value that is expected + The path to a file containing the actual value + + + + Attribute used to provide descriptive text about a + test case or fixture. + + + + + Construct the attribute + + Text describing the test + + + + Gets the test description + + + + + Interface implemented by a user fixture in order to + validate any expected exceptions. It is only called + for test methods marked with the ExpectedException + attribute. + + + + + Method to handle an expected exception + + The exception to be handled + + + + TextMessageWriter writes constraint descriptions and messages + in displayable form as a text stream. It tailors the display + of individual message components to form the standard message + format of NUnit assertion failure messages. + + + + + Prefix used for the expected value line of a message + + + + + Prefix used for the actual value line of a message + + + + + Length of a message prefix + + + + + Construct a TextMessageWriter + + + + + Construct a TextMessageWriter, specifying a user message + and optional formatting arguments. + + + + + + + Method to write single line message with optional args, usually + written to precede the general failure message, at a givel + indentation level. + + The indentation level of the message + The message to be written + Any arguments used in formatting the message + + + + Display Expected and Actual lines for a constraint. This + is called by MessageWriter's default implementation of + WriteMessageTo and provides the generic two-line display. + + The constraint that failed + + + + Display Expected and Actual lines for given values. This + method may be called by constraints that need more control over + the display of actual and expected values than is provided + by the default implementation. + + The expected value + The actual value causing the failure + + + + Display Expected and Actual lines for given values, including + a tolerance value on the expected line. + + The expected value + The actual value causing the failure + The tolerance within which the test was made + + + + Display the expected and actual string values on separate lines. + If the mismatch parameter is >=0, an additional line is displayed + line containing a caret that points to the mismatch point. + + The expected string value + The actual string value + The point at which the strings don't match or -1 + If true, case is ignored in string comparisons + If true, clip the strings to fit the max line length + + + + Writes the text for a connector. + + The connector. + + + + Writes the text for a predicate. + + The predicate. + + + + Write the text for a modifier. + + The modifier. + + + + Writes the text for an expected value. + + The expected value. + + + + Writes the text for an actual value. + + The actual value. + + + + Writes the text for a generalized value. + + The value. + + + + Writes the text for a collection value, + starting at a particular point, to a max length + + The collection containing elements to write. + The starting point of the elements to write + The maximum number of elements to write + + + + Write the generic 'Expected' line for a constraint + + The constraint that failed + + + + Write the generic 'Expected' line for a given value + + The expected value + + + + Write the generic 'Expected' line for a given value + and tolerance. + + The expected value + The tolerance within which the test was made + + + + Write the generic 'Actual' line for a constraint + + The constraint for which the actual value is to be written + + + + Write the generic 'Actual' line for a given value + + The actual value causing a failure + + + + Gets or sets the maximum line length for this writer + + + + + AssertionHelper is an optional base class for user tests, + allowing the use of shorter names for constraints and + asserts and avoiding conflict with the definition of + , from which it inherits much of its + behavior, in certain mock object frameworks. + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. Works + identically to + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to + . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the method throws + an . Works Identically to . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Returns a ListMapper based on a collection. + + The original collection + + + + + Abstract base for Attributes that are used to include tests + in the test run based on environmental settings. + + + + + Constructor with no included items specified, for use + with named property syntax. + + + + + Constructor taking one or more included items + + Comma-delimited list of included items + + + + Name of the item that is needed in order for + a test to run. Multiple itemss may be given, + separated by a comma. + + + + + Name of the item to be excluded. Multiple items + may be given, separated by a comma. + + + + + The reason for including or excluding the test + + + + + PlatformAttribute is used to mark a test fixture or an + individual method as applying to a particular platform only. + + + + + Constructor with no platforms specified, for use + with named property syntax. + + + + + Constructor taking one or more platforms + + Comma-deliminted list of platforms + + + + CultureAttribute is used to mark a test fixture or an + individual method as applying to a particular Culture only. + + + + + Constructor with no cultures specified, for use + with named property syntax. + + + + + Constructor taking one or more cultures + + Comma-deliminted list of cultures + + + + Summary description for SetCultureAttribute. + + + + + Construct given the name of a culture + + + + + + GlobalSettings is a place for setting default values used + by the framework in performing asserts. + + + + + Default tolerance for floating point equality + + + + + Summary description for DirectoryAssert + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are not equal + + + + Verifies that two directories are equal. Two directories are considered + equal if both are null, or if both have the same value byte for byte. + If they are not equal an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + The message to display if directories are not equal + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory containing the value that is expected + A directory containing the actual value + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are equal + Arguments to be used in formatting the message + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + The message to display if directories are equal + + + + Asserts that two directories are not equal. If they are equal + an is thrown. + + A directory path string containing the value that is expected + A directory path string containing the actual value + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is empty. If it is not empty + an is thrown. + + A directory to search + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + Arguments to be used in formatting the message + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + The message to display if directories are not equal + + + + Asserts that the directory is not empty. If it is empty + an is thrown. + + A directory to search + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path contains actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + Arguments to be used in formatting the message + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + The message to display if directory is not within the path + + + + Asserts that path does not contain actual as a subdirectory or + an is thrown. + + A directory to search + sub-directory asserted to exist under directory + + + + TestCaseAttribute is used to mark parameterized test cases + and provide them with their arguments. + + + + + The ITestCaseData interface is implemented by a class + that is able to return complete testcases for use by + a parameterized test method. + + NOTE: This interface is used in both the framework + and the core, even though that results in two different + types. However, sharing the source code guarantees that + the various implementations will be compatible and that + the core is able to reflect successfully over the + framework implementations of ITestCaseData. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Construct a TestCaseAttribute with a list of arguments. + This constructor is not CLS-Compliant + + + + + + Construct a TestCaseAttribute with a single argument + + + + + + Construct a TestCaseAttribute with a two arguments + + + + + + + Construct a TestCaseAttribute with a three arguments + + + + + + + + Gets the list of arguments to a test case + + + + + Gets or sets the expected result. + + The result. + + + + Gets or sets the expected exception. + + The expected exception. + + + + Gets or sets the name the expected exception. + + The expected name of the exception. + + + + Gets or sets the expected message of the expected exception + + The expected message of the exception. + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets or sets the description. + + The description. + + + + Gets or sets the name of the test. + + The name of the test. + + + + Gets or sets the ignored status of the test + + + + + Gets or sets the ignored status of the test + + + + + Gets the ignore reason. + + The ignore reason. + + + + The TestCaseData class represents a set of arguments + and other parameter info to be used for a parameterized + test case. It provides a number of instance modifiers + for use in initializing the test case. + + Note: Instance modifiers are getters that return + the same instance after modifying it's state. + + + + + The argument list to be provided to the test + + + + + The expected result to be returned + + + + + The expected exception Type + + + + + The FullName of the expected exception + + + + + The name to be used for the test + + + + + The description of the test + + + + + A dictionary of properties, used to add information + to tests without requiring the class to change. + + + + + If true, indicates that the test case is to be ignored + + + + + The reason for ignoring a test case + + + + + Initializes a new instance of the class. + + The arguments. + + + + Initializes a new instance of the class. + + The argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + + + + Initializes a new instance of the class. + + The first argument. + The second argument. + The third argument. + + + + Sets the expected result for the test + + The expected result + A modified TestCaseData + + + + Sets the expected exception type for the test + + Type of the expected exception. + The modified TestCaseData instance + + + + Sets the expected exception type for the test + + FullName of the expected exception. + The modified TestCaseData instance + + + + Sets the name of the test case + + The modified TestCaseData instance + + + + Sets the description for the test case + being constructed. + + The description. + The modified TestCaseData instance. + + + + Applies a category to the test + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Applies a named property to the test + + + + + + + + Ignores this TestCase. + + + + + + Ignores this TestCase, specifying the reason. + + The reason. + + + + + Gets the argument list to be provided to the test + + + + + Gets the expected result + + + + + Gets the expected exception Type + + + + + Gets the FullName of the expected exception + + + + + Gets the name to be used for the test + + + + + Gets the description of the test + + + + + Gets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets the ignore reason. + + The ignore reason. + + + + Gets a list of categories associated with this test. + + + + + Gets the property dictionary for this test + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when a test executes inconclusively. + + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Attribute used to identify a method that is + called before any tests in a fixture are run. + + + + + Attribute used to identify a method that is called after + all the tests in a fixture have run. The method is + guaranteed to be called, even if an exception is thrown. + + + + + Attribute used to apply a category to a test + + + + + The name of the category + + + + + Construct attribute for a given category + + The name of the category + + + + Protected constructor uses the Type name as the name + of the category. + + + + + The name of the category + + + + + ExplicitAttribute marks a test or test fixture so that it will + only be run if explicitly executed from the gui or command line + or if it is included by use of a filter. The test will not be + run simply because an enclosing suite is run. + + + + + Default constructor + + + + + Constructor with a reason + + The reason test is marked explicit + + + + The reason test is marked explicit + + + + + Thrown when an assertion failed. + + + + + The error message that explains + the reason for the exception + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Thrown when an assertion failed. + + + + + + + The error message that explains + the reason for the exception + The exception that caused the + current exception + + + + Serialization Constructor + + + + + Enumeration indicating how the expected message parameter is to be used + + + + Expect an exact match + + + Expect a message containing the parameter string + + + Match the regular expression provided as a parameter + + + Expect a message that starts with the parameter string + + + + ExpectedExceptionAttribute + + + + + + Constructor for a non-specific exception + + + + + Constructor for a given type of exception + + The type of the expected exception + + + + Constructor for a given exception name + + The full name of the expected exception + + + + Gets or sets the expected exception type + + + + + Gets or sets the full Type name of the expected exception + + + + + Gets or sets the expected message text + + + + + Gets or sets the user message displayed in case of failure + + + + + Gets or sets the type of match to be performed on the expected message + + + + + Gets the name of a method to be used as an exception handler + + + + + Attribute used to mark a test that is to be ignored. + Ignored tests result in a warning message when the + tests are run. + + + + + Constructs the attribute without giving a reason + for ignoring the test. + + + + + Constructs the attribute giving a reason for ignoring the test + + The reason for ignoring the test + + + + The reason for ignoring a test + + + + + Attribute used to mark a class that contains one-time SetUp + and/or TearDown methods that apply to all the tests in a + namespace or an assembly. + + + + + Attribute used to mark a static (shared in VB) property + that returns a list of tests. + + + + + Attribute used to identify a method that is called + immediately after each test is run. The method is + guaranteed to be called, even if an exception is thrown. + + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + Descriptive text for this test + + + + + [TestFixture] + public class ExampleClass + {} + + + + + Default constructor + + + + + Construct with a object[] representing a set of arguments. + In .NET 2.0, the arguments may later be separated into + type arguments and constructor arguments. + + + + + + Descriptive text for this fixture + + + + + The arguments originally provided to the attribute + + + + + Gets or sets a value indicating whether this should be ignored. + + true if ignore; otherwise, false. + + + + Gets or sets the ignore reason. May set Ignored as a side effect. + + The ignore reason. + + + + Get or set the type arguments. If not set + explicitly, any leading arguments that are + Types are taken as type arguments. + + + + + RequiredAddinAttribute may be used to indicate the names of any addins + that must be present in order to run some or all of the tests in an + assembly. If the addin is not loaded, the entire assembly is marked + as NotRunnable. + + + + + Initializes a new instance of the class. + + The required addin. + + + + Gets the name of required addin. + + The required addin name. + + + + Marks a test to use a combinatorial join of any argument data + provided. NUnit will create a test case for every combination of + the arguments provided. This can result in a large number of test + cases and so should be used judiciously. This is the default join + type, so the attribute need not be used except as documentation. + + + + + Default constructor + + + + + Marks a test to use pairwise join of any argument data provided. + NUnit will attempt too excercise every pair of argument values at + least once, using as small a number of test cases as it can. With + only two arguments, this is the same as a combinatorial join. + + + + + Default constructor + + + + + Marks a test to use a sequential join of any argument data + provided. NUnit will use arguements for each parameter in + sequence, generating test cases up to the largest number + of argument values provided and using null for any arguments + for which it runs out of values. Normally, this should be + used with the same number of arguments for each parameter. + + + + + Default constructor + + + + + Abstract base class for attributes that apply to parameters + and supply data for the parameter. + + + + + Gets the data to be provided to the specified parameter + + + + + ValuesAttribute is used to provide literal arguments for + an individual parameter of a test. + + + + + The collection of data to be returned. Must + be set by any derived attribute classes. + + + + + Construct with one argument + + + + + + Construct with two arguments + + + + + + + Construct with three arguments + + + + + + + + Construct with an array of arguments + + + + + + Get the collection of values to be used as arguments + + + + + RandomAttribute is used to supply a set of random values + to a single parameter of a parameterized test. + + + + + Construct a set of doubles from 0.0 to 1.0, + specifying only the count. + + + + + + Construct a set of doubles from min to max + + + + + + + + Construct a set of ints from min to max + + + + + + + + Get the collection of values to be used as arguments + + + + + RangeAttribute is used to supply a range of values to an + individual parameter of a parameterized test. + + + + + Construct a range of ints using default step of 1 + + + + + + + Construct a range of ints specifying the step size + + + + + + + + Construct a range of longs + + + + + + + + Construct a range of doubles + + + + + + + + Construct a range of floats + + + + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a new PropertyConstraintExpression, which will either + test for the existence of the named property on the object + being tested or apply any following constraint to that property. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new AttributeConstraint checking for the + presence of a particular attribute on an object. + + + + + Returns a new CollectionContainsConstraint checking for the + presence of a particular object in the collection. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if at least one of them succeeds. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them fail. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Length property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Count property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the Message property of the object being tested. + + + + + Returns a new ConstraintExpression, which will apply the following + constraint to the InnerException property of the object being tested. + + + + + Helper class with properties and methods that supply + a number of constraints used in Asserts. + + + + + Returns a constraint that tests two items for equality + + + + + Returns a constraint that tests that two references are the same object + + + + + Returns a constraint that tests whether the + actual value is greater than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is greater than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the + actual value is less than or equal to the suppled argument + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual + value is of the exact type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is of the type supplied as an argument or a derived type. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is assignable from the type supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a collection containing the same elements as the + collection supplied as an argument. + + + + + Returns a constraint that tests whether the actual value + is a subset of the collection supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that tests whether the path provided + is the same as an expected path after canonicalization. + + + + + Returns a constraint that tests whether the path provided + is the same path or under an expected path after canonicalization. + + + + + Returns a constraint that tests whether the actual value falls + within a specified range. + + + + + Returns a ConstraintExpression that negates any + following constraint. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Returns a constraint that tests for null + + + + + Returns a constraint that tests for True + + + + + Returns a constraint that tests for False + + + + + Returns a constraint that tests for NaN + + + + + Returns a constraint that tests for empty + + + + + Returns a constraint that tests whether a collection + contains all unique items. + + + + + Returns a constraint that tests whether an object graph is serializable in binary format. + + + + + Returns a constraint that tests whether an object graph is serializable in xml format. + + + + + Returns a constraint that tests whether a collection is ordered + + + + + The List class is a helper class with properties and methods + that supply a number of constraints used with lists and collections. + + + + + List.Map returns a ListMapper, which can be used to map + the original collection to another collection. + + + + + + + ListMapper is used to transform a collection used as an actual argument + producing another collection to be used in the assertion. + + + + + Construct a ListMapper based on a collection + + The collection to be transformed + + + + Produces a collection containing all the values of a property + + The collection of property values + + + + + Helper class with static methods used to supply constraints + that operate on strings. + + + + + Returns a constraint that succeeds if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value contains the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value starts with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that fails if the actual + value ends with the substring supplied as an argument. + + + + + Returns a constraint that succeeds if the actual + value matches the Regex pattern supplied as an argument. + + + + + Returns a constraint that fails if the actual + value matches the pattern supplied as an argument. + + + + + Returns a ConstraintExpression, which will apply + the following constraint to all members of a collection, + succeeding if all of them succeed. + + + + + Helper class with properties and methods that supply + constraints that operate on exceptions. + + + + + Creates a constraint specifying the exact type of exception expected + + + + + Creates a constraint specifying the exact type of exception expected + + + + + Creates a constraint specifying the type of exception expected + + + + + Creates a constraint specifying the type of exception expected + + + + + Creates a constraint specifying an expected exception + + + + + Creates a constraint specifying an exception with a given InnerException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying an expected TargetInvocationException + + + + + Creates a constraint specifying that no exception is thrown + + + + + FactoryAttribute indicates the source to be used to + provide test cases for a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + An array of the names of the factories that will provide data + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + ValueSourceAttribute indicates the source to be used to + provide data for one parameter of a test method. + + + + + Construct with the name of the factory - for use with languages + that don't support params arrays. + + The name of the data source to be used + + + + Construct with a Type and name - for use with languages + that don't support params arrays. + + The Type that will provide data + The name of the method, property or field that will provide data + + + + The name of a the method, property or fiend to be used as a source + + + + + A Type to be used as a source + + + + + The Iz class is a synonym for Is intended for use in VB, + which regards Is as a keyword. + + + + + WUsed on a method, marks the test with a timeout value in milliseconds. + The test will be run in a separate thread and is cancelled if the timeout + is exceeded. Used on a method or assembly, sets the default timeout + for all contained test methods. + + + + + Construct a TimeoutAttribute given a time in milliseconds + + The timeout value in milliseconds + + + + Marks a test that must run in the STA, causing it + to run in a separate thread if necessary. + + On methods, you may also use STAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresSTAAttribute + + + + + Marks a test that must run in the MTA, causing it + to run in a separate thread if necessary. + + On methods, you may also use MTAThreadAttribute + to serve the same purpose. + + + + + Construct a RequiresMTAAttribute + + + + + Marks a test that must run on a separate thread. + + + + + Construct a RequiresThreadAttribute + + + + + Construct a RequiresThreadAttribute, specifying the apartment + + + + + Summary description for MaxTimeAttribute. + + + + + Construct a MaxTimeAttribute, given a time in milliseconds. + + The maximum elapsed time in milliseconds + + + + RepeatAttribute may be applied to test case in order + to run it multiple times. + + + + + Construct a RepeatAttribute + + The number of times to run the test + + + + Provides static methods to express the assumptions + that must be met for a test to give a meaningful + result. If an assumption is not met, the test + should produce an inconclusive result. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an InconclusiveException on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the + method throws an . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Randomizer returns a set of random values in a repeatable + way, to allow re-running of tests if necessary. + + + + + Get a randomizer for a particular member, returning + one that has already been created if it exists. + This ensures that the same values are generated + each time the tests are reloaded. + + + + + Get a randomizer for a particular parameter, returning + one that has already been created if it exists. + This ensures that the same values are generated + each time the tests are reloaded. + + + + + Construct a randomizer using a random seed + + + + + Construct a randomizer using a specified seed + + + + + Return an array of random doubles between 0.0 and 1.0. + + + + + + + Return an array of random doubles with values in a specified range. + + + + + Return an array of random ints with values in a specified range. + + + + + Get a random seed for use in creating a randomizer. + + + + + Adding this attribute to a method within a + class makes the method callable from the NUnit test runner. There is a property + called Description which is optional which you can provide a more detailed test + description. This class cannot be inherited. + + + + [TestFixture] + public class Fixture + { + [Test] + public void MethodToTest() + {} + + [Test(Description = "more detailed description")] + publc void TestDescriptionMethod() + {} + } + + + + + + Used to mark a field for use as a datapoint when executing a theory + within the same fixture that requires an argument of the field's Type. + + + + + Used to mark an array as containing a set of datapoints to be used + executing a theory within the same fixture that requires an argument + of the Type of the array elements. + + + + + The SpecialValue enum is used to represent TestCase arguments + that cannot be used as arguments to an Attribute. + + + + + Null represents a null value, which cannot be used as an + argument to an attriute under .NET 1.x + + + + + Summary description for SetUICultureAttribute. + + + + + Construct given the name of a culture + + + + + + Delegate used by tests that execute code and + capture any thrown exception. + + + + + The Assert class contains a collection of static methods that + implement the most common assertions used in NUnit. + + + + + We don't actually want any instances of this object, but some people + like to inherit from it to add other static methods. Hence, the + protected constructor disallows any instances of this object. + + + + + The Equals method throws an AssertionException. This is done + to make sure there is no mistake by calling this function. + + + + + + + override the default ReferenceEquals to throw an AssertionException. This + implementation makes sure there is no mistake in calling this function + as part of Assert. + + + + + + + Helper for Assert.AreEqual(double expected, double actual, ...) + allowing code generation to work consistently. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + The message to initialize the with. + + + + Throws a with the message and arguments + that are passed in. This allows a test to be cut short, with a result + of success returned to NUnit. + + + + + Throws an with the message and arguments + that are passed in. This is used by the other Assert functions. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This is used by the other Assert functions. + + The message to initialize the with. + + + + Throws an . + This is used by the other Assert functions. + + + + + Throws an with the message and arguments + that are passed in. This causes the test to be reported as ignored. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This causes the test to be reported as ignored. + + The message to initialize the with. + + + + Throws an . + This causes the test to be reported as ignored. + + + + + Throws an with the message and arguments + that are passed in. This causes the test to be reported as inconclusive. + + The message to initialize the with. + Arguments to be used in formatting the message + + + + Throws an with the message that is + passed in. This causes the test to be reported as inconclusive. + + The message to initialize the with. + + + + Throws an . + This causes the test to be reported as Inconclusive. + + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint expression to be applied + An ActualValueDelegate returning the value to be tested + The message that will be displayed on failure + + + + Apply a constraint to an actual value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + An ActualValueDelegate returning the value to be tested + A Constraint expression to be applied + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + + + + Apply a constraint to a referenced value, succeeding if the constraint + is satisfied and throwing an assertion exception on failure. + + A Constraint to be applied + The actual value to test + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + Arguments to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display if the condition is false + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that the code represented by a delegate throws an exception + that satisfies the constraint provided. + + A TestDelegate to be executed + A ThrowsConstraint used in the test + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + A constraint to be satisfied by the exception + A TestSnippet delegate + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + The exception Type expected + A TestSnippet delegate + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate throws a particular exception when called. + + Type of the expected exception + A TestSnippet delegate + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception when called + and returns it. + + A TestDelegate + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + The message that will be displayed on failure + + + + Verifies that a delegate throws an exception of a certain Type + or one derived from it when called and returns it. + + The expected Exception Type + A TestDelegate + + + + Verifies that a delegate does not throw an exception + + A TestSnippet delegate + The message that will be displayed on failure + Arguments to be used in formatting the message + + + + Verifies that a delegate does not throw an exception. + + A TestSnippet delegate + The message that will be displayed on failure + + + + Verifies that a delegate does not throw an exception. + + A TestSnippet delegate + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is true. If the condition is false the method throws + an . + + The evaluated condition + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + The message to display in case of failure + + + + Asserts that a condition is false. If the condition is true the method throws + an . + + The evaluated condition + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is not equal to null + If the object is null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + The message to display in case of failure + + + + Verifies that the object that is passed in is equal to null + If the object is not null then an + is thrown. + + The object that is to be tested + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + The message to display in case of failure + + + + Verifies that the double that is passed in is an NaN value. + If the object is not NaN then an + is thrown. + + The value that is to be tested + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is empty - that is equal to string.Empty + + The string to be tested + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + + + + Assert that an array, list or other collection is empty + + An array, list or other collection implementing ICollection + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is not empty - that is not equal to string.Empty + + The string to be tested + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + The message to display in case of failure + + + + Assert that an array, list or other collection is not empty + + An array, list or other collection implementing ICollection + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is either null or equal to string.Empty + + The string to be tested + + + + Assert that a string is not null or empty + + The string to be tested + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Assert that a string is not null or empty + + The string to be tested + The message to display in case of failure + + + + Assert that a string is not null or empty + + The string to be tested + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + The message to display in case of failure + + + + Asserts that an object may not be assigned a value of a given Type. + + The expected Type. + The object under examination + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + The message to display in case of failure + + + + Asserts that an object is not an instance of a given type. + + The expected Type + The object being examined + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are equal. If they are not, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + The message to display in case of failure + + + + Verifies that two doubles are equal considering a delta. If the + expected value is infinity then the delta value is ignored. If + they are not equal then an is + thrown. + + The expected value + The actual value + The maximum acceptable difference between the + the expected and the actual + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + + + + Verifies that two objects are equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are not equal an is thrown. + + The value that is expected + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + The message to display in case of failure + + + + Verifies that two values are not equal. If they are equal, then an + is thrown. + + The expected value + The actual value + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + The message to display in case of failure + + + + Verifies that two objects are not equal. Two objects are considered + equal if both are null, or if both have the same value. NUnit + has special semantics for some object types. + If they are equal an is thrown. + + The value that is expected + The actual value + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + + + + Asserts that two objects refer to the same object. If they + are not the same an is thrown. + + The expected object + The actual object + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + The message to display in case of failure + + + + Asserts that two objects do not refer to the same object. If they + are the same an is thrown. + + The expected object + The actual object + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than the second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + The message to display in case of failure + + + + Verifies that the first value is greater than or equal tothe second + value. If it is not, then an + is thrown. + + The first value, expected to be greater + The second value, expected to be less + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + The message to display in case of failure + + + + Verifies that the first value is less than or equal to the second + value. If it is not, then an + is thrown. + + The first value, expected to be less + The second value, expected to be greater + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + The message to display in case of failure + Array of objects to be used in formatting the message + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + The message to display in case of failure + + + + Asserts that an object is contained in a list. + + The expected object + The list to be examined + + + + Gets the number of assertions executed so far and + resets the counter to zero. + + + + + Static helper class used in the constraint-based syntax + + + + + Creates a new SubstringConstraint + + The value of the substring + A SubstringConstraint + + + + Creates a new CollectionContainsConstraint. + + The item that should be found. + A new CollectionContainsConstraint + + + diff --git a/lib/nunit/nunit.util.dll b/lib/nunit/nunit.util.dll new file mode 100644 index 000000000..e9c515f05 Binary files /dev/null and b/lib/nunit/nunit.util.dll differ