Skip to content

Commit

Permalink
Bump NUnit from 3.14.0 to 4.0.1 (#245)
Browse files Browse the repository at this point in the history
* Bump NUnit from 3.14.0 to 4.0.1

Bumps [NUnit](https://github.com/nunit/nunit) from 3.14.0 to 4.0.1.
- [Release notes](https://github.com/nunit/nunit/releases)
- [Changelog](https://github.com/nunit/nunit/blob/master/CHANGES.md)
- [Commits](nunit/nunit@v3.14.0...v4.0.1)

---
updated-dependencies:
- dependency-name: NUnit
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Resolve build errors from updating NUnit to 4.0.1

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Millicent Achieng <[email protected]>
  • Loading branch information
dependabot[bot] and millicentachieng authored Jan 12, 2024
1 parent 3ad77fd commit 443405b
Show file tree
Hide file tree
Showing 15 changed files with 139 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void TestInlineComplexTypeDescription()
ComplexType ct = this.GetComplexType(this.schema, "Test", inlineDescription: inlineDescription);
string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, ct);

Assert.IsTrue(markDown.Contains(inlineDescription), "Generated markdown should contain inline description annotation");
Assert.That(markDown.Contains(inlineDescription), "Generated markdown should contain inline description annotation");
}

[Test]
Expand All @@ -50,7 +50,7 @@ public void TestInlinePropertyDescription()
this.AddProperty(ct, "TestProperty", inlineDescription: inlineDescription);
string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, ct);

Assert.IsTrue(markDown.Contains(inlineDescription), "Generated markdown should contain inline description annotation");
Assert.That(markDown.Contains(inlineDescription), "Generated markdown should contain inline description annotation");
}

[Test]
Expand All @@ -60,7 +60,7 @@ public void TestSchemaComplexTypeDescription()
ComplexType ct = this.GetComplexType(this.schema, "Test", schemaDescription: schemaDescription);
string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, ct);

Assert.IsTrue(markDown.Contains(schemaDescription), "Generated markdown should contain schema description annotation");
Assert.That(markDown.Contains(schemaDescription), "Generated markdown should contain schema description annotation");
}

[Test]
Expand All @@ -70,7 +70,7 @@ public void TestSchemaPropertyDescription()
ComplexType ct = this.GetComplexType(this.schema, "Test", schemaDescription: schemaDescription);
string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, ct);

Assert.IsTrue(markDown.Contains(schemaDescription), "Generated markdown should contain schema description annotation");
Assert.That(markDown.Contains(schemaDescription), "Generated markdown should contain schema description annotation");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void RelationshipTableEntryIsCorrectlyFormattedForEntity()
this.AddNavigationProperty(entity, propertyName, propertyType, inlineDescription: description);
string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, entity);

Assert.IsTrue(markDown.Contains(expected), "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
Assert.That(markDown.Contains(expected), Is.True, "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
}

[Test]
Expand All @@ -62,7 +62,7 @@ public void RelationshipTableEntryIsCorrectlyFormattedForEntityCollection()
this.AddNavigationProperty(entity, propertyName, propertyType, inlineDescription: description);
string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, entity);

Assert.IsTrue(markDown.Contains(expected), "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
Assert.That(markDown.Contains(expected), Is.True, "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
}
}
}
8 changes: 4 additions & 4 deletions ApiDoctor.DocumentationGeneration.UnitTests/PropertyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void PropertyTableEntryIsCorrectlyFormattedForComplexType()

string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, ct);

Assert.IsTrue(markDown.Contains(expected), "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
Assert.That(markDown.Contains(expected), Is.True, "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
}

[Test]
Expand All @@ -64,7 +64,7 @@ public void PropertyTableEntryIsCorrectlyFormattedForComplexTypeCollection()

string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, ct);

Assert.IsTrue(markDown.Contains(expected), "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
Assert.That(markDown.Contains(expected), Is.True, "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
}

[Test]
Expand All @@ -78,7 +78,7 @@ public void PropertyTableEntryIsCorrectlyFormattedForPrimitiveType()
this.AddProperty(ct, propertyName, type: $"Edm.{propertyType}", inlineDescription: description);
string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, ct);

Assert.IsTrue(markDown.Contains(expected), "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
Assert.That(markDown.Contains(expected), Is.True, "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
}

[Test]
Expand All @@ -92,7 +92,7 @@ public void PropertyTableEntryIsCorrectlyFormattedForPrimitiveTypeCollection()
this.AddProperty(ct, propertyName, type: $"Collection(Edm.{propertyType})", inlineDescription: description);
string markDown = this.documentationGenerator.GetMarkDownForType(this.entityFramework, ct);

Assert.IsTrue(markDown.Contains(expected), "Generated markdown should contain '{0}' Actual:\n{1}", expected, markDown);
Assert.That(markDown.Contains(expected), Is.True, $"Generated markdown should contain '{expected}' Actual:\n{markDown}");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void TestRoudTripEntityType()

DocFile testFile = this.GetDocFileForEntityType(entity);

Assert.AreEqual(1, testFile.Resources.Length, "Expected to find one resource");
Assert.That(1, Is.EqualTo(testFile.Resources.Length), "Expected to find one resource");
var resource = testFile.Resources[0];
this.VerifyEntityType(entity, resource);
}
Expand All @@ -76,7 +76,7 @@ public void TestRoundTripComplexType()

DocFile testFile = this.GetDocFileForComplexType(testType);

Assert.AreEqual(1, testFile.Resources.Length, "Expected to find one resource");
Assert.That(1, Is.EqualTo(testFile.Resources.Length), "Expected to find one resource");
var resource = testFile.Resources[0];
this.VerifyComplexType(testType, resource);
}
Expand All @@ -90,7 +90,7 @@ private DocFile GetDocFileForComplexType(ComplexType testType)
DocFile testFile = new DocFileForTesting(markDown, @"\resources.md", @"\resources.md", docSet);
var issues = new IssueLogger();
testFile.Scan(string.Empty, issues.For("testFile"));
Assert.IsFalse(issues.Issues.WereWarningsOrErrors(), "Expected no validation warnings/errors: {0}", issues.Issues.ErrorsToString());
Assert.That(issues.Issues.WereWarningsOrErrors(), Is.False, "Expected no validation warnings/errors: {0}", issues.Issues.ErrorsToString());
return testFile;
}

Expand All @@ -103,44 +103,44 @@ private DocFile GetDocFileForEntityType(EntityType testType)
DocFile testFile = new DocFileForTesting(markDown, @"\resources.md", @"\resources.md", docSet);
var issues = new IssueLogger();
testFile.Scan(string.Empty, issues.For("testFile"));
Assert.IsFalse(issues.Issues.WereWarningsOrErrors(), "Expected no validation warnings/errors: {0}", issues.Issues.Where(e => e.IsWarningOrError).ErrorsToString());
Assert.That(issues.Issues.WereWarningsOrErrors(), Is.False, "Expected no validation warnings/errors: {0}", issues.Issues.Where(e => e.IsWarningOrError).ErrorsToString());
return testFile;
}

private void VerifyComplexType(ComplexType testType, ResourceDefinition resource)
{
Assert.AreEqual($"{this.schema.Namespace}.{testType.Name}", resource.Name, "Resource name does not match");
Assert.That($"{this.schema.Namespace}.{testType.Name}", Is.EqualTo(resource.Name), "Resource name does not match");

// Ignore the odata.type property
var resourceProperties = resource.Parameters.Where(p => p.Name != "@odata.type" && !p.IsNavigatable).ToList();

Assert.AreEqual(testType.Properties.Count, resourceProperties.Count(), "Property count does not match");
Assert.That(testType.Properties.Count, Is.EqualTo(resourceProperties.Count()), "Property count does not match");

for (int i = 0; i < resourceProperties.Count; i++)
{
Assert.AreEqual(testType.Properties[i].Name, resourceProperties[i].Name, "Name of property does not match");
Assert.AreEqual(testType.Properties[i].Type, resourceProperties[i].Type.ODataResourceName(), "Type of property {0} does not match", testType.Properties[i].Name);
Assert.AreEqual(testType.Properties[i].ToDocumentationProperty(this.entityFramework, testType).Description, resourceProperties[i].Description, "Description for property {0} does not match", testType.Properties[i].Name);
Assert.That(testType.Properties[i].Name, Is.EqualTo(resourceProperties[i].Name), "Name of property does not match");
Assert.That(testType.Properties[i].Type, Is.EqualTo(resourceProperties[i].Type.ODataResourceName()), "Type of property {0} does not match", testType.Properties[i].Name);
Assert.That(testType.Properties[i].ToDocumentationProperty(this.entityFramework, testType).Description, Is.EqualTo(resourceProperties[i].Description), "Description for property {0} does not match", testType.Properties[i].Name);
}
}

private void VerifyEntityType(EntityType testType, ResourceDefinition resource)
{
this.VerifyComplexType(testType, resource);
Assert.AreEqual($"{this.schema.Namespace}.{testType.Name}", resource.Name, "Resource name does not match");
Assert.That($"{this.schema.Namespace}.{testType.Name}", Is.EqualTo(resource.Name), "Resource name does not match");

// Ignore the odata.type property
var navigationProperties = resource.Parameters.Where(p => p.IsNavigatable).ToList();

Assert.AreEqual(testType.NavigationProperties.Count, navigationProperties.Count(), "Navigation Property count does not match");
Assert.That(testType.NavigationProperties.Count, Is.EqualTo(navigationProperties.Count()), "Navigation Property count does not match");

for (int i = 0; i < navigationProperties.Count; i++)
{
Assert.AreEqual(testType.NavigationProperties[i].Name, navigationProperties[i].Name, "Name of navigation property does not match");
Assert.That(testType.NavigationProperties[i].Name, Is.EqualTo(navigationProperties[i].Name), "Name of navigation property does not match");

// TODO: Fix parsing of Navigation Property types
// Assert.AreEqual(testType.NavigationProperties[i].Type, navigationProperties[i].Type.ODataResourceName(), "Type of navigation property {0} does not match", testType.NavigationProperties[i].Name);
Assert.AreEqual(testType.NavigationProperties[i].ToDocumentationProperty(this.entityFramework, testType).Description, navigationProperties[i].Description, "Description for property {0} does not match", testType.NavigationProperties[i].Name);
Assert.That(testType.NavigationProperties[i].ToDocumentationProperty(this.entityFramework, testType).Description, Is.EqualTo(navigationProperties[i].Description), "Description for property {0} does not match", testType.NavigationProperties[i].Name);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
Expand Down
40 changes: 20 additions & 20 deletions ApiDoctor.Validation.UnitTests/BrokenLinkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ [Up one level](../anotherfile.md)
TestableDocFile file = new TestableDocFile(markdown);
var issues = new IssueLogger();

Assert.IsTrue(file.Scan(string.Empty, issues));
Assert.IsEmpty(issues.Issues.WarningsOrErrorsOnly());
Assert.That(file.Scan(string.Empty, issues));
Assert.That(issues.Issues.WarningsOrErrorsOnly(), Is.Empty);

Assert.IsTrue(file.ValidateNoBrokenLinks(false, issues, true));
Assert.IsEmpty(issues.Issues.WarningsOrErrorsOnly());
Assert.That(file.ValidateNoBrokenLinks(false, issues, true));
Assert.That(issues.Issues.WarningsOrErrorsOnly(), Is.Empty);
}


Expand All @@ -75,14 +75,14 @@ This link goes [up one level](../anotherfile.md)

var issues = new IssueLogger();

Assert.IsTrue(file.Scan(string.Empty, issues));
Assert.That(file.Scan(string.Empty, issues));
var realErrors = from e in issues.Issues where e.IsWarning || e.IsError select e;
Assert.IsEmpty(realErrors);
Assert.That(realErrors, Is.Empty);

Assert.IsFalse(file.ValidateNoBrokenLinks(false, issues, false));
Assert.That(file.ValidateNoBrokenLinks(false, issues, false), Is.False);
realErrors = from e in issues.Issues where e.IsWarning || e.IsError select e;
Assert.AreEqual(1, realErrors.Count());
Assert.IsTrue(realErrors.First().Code == ValidationErrorCode.MissingLinkSourceId);
Assert.That(1, Is.EqualTo(realErrors.Count()));
Assert.That(realErrors.First().Code == ValidationErrorCode.MissingLinkSourceId);
}


Expand Down Expand Up @@ -115,12 +115,12 @@ This link goes [up one level](../anotherfile.md)

var issues = new IssueLogger();

Assert.IsTrue(file.Scan(string.Empty, issues));
Assert.IsEmpty(issues.Issues.WarningsOrErrorsOnly());
Assert.That(file.Scan(string.Empty, issues));
Assert.That(issues.Issues.WarningsOrErrorsOnly(), Is.Empty);

Assert.IsFalse(file.ValidateNoBrokenLinks(false, issues, false));
Assert.AreEqual(1, issues.Issues.WarningsOrErrorsOnly().Count());
Assert.IsTrue(issues.Issues.Any(i => i.Code == ValidationErrorCode.LinkDestinationNotFound));
Assert.That(file.ValidateNoBrokenLinks(false, issues, false), Is.False);
Assert.That(1, Is.EqualTo(issues.Issues.WarningsOrErrorsOnly().Count()));
Assert.That(issues.Issues.Any(i => i.Code == ValidationErrorCode.LinkDestinationNotFound));
}

[Test]
Expand All @@ -142,13 +142,13 @@ This link goes [up one level](../anotherfile.md)

var issues = new IssueLogger();

Assert.IsTrue(file.Scan(string.Empty, issues));
Assert.IsEmpty(issues.Issues.WarningsOrErrorsOnly());
Assert.That(file.Scan(string.Empty, issues));
Assert.That(issues.Issues.WarningsOrErrorsOnly(), Is.Empty);

Assert.IsFalse(file.ValidateNoBrokenLinks(false, issues, false));
Assert.AreEqual(2, issues.Issues.WarningsOrErrorsOnly().Count());
Assert.IsTrue(issues.Issues.Any(i => i.Code == ValidationErrorCode.MissingLinkSourceId));
Assert.IsTrue(issues.Issues.Any(i => i.Code == ValidationErrorCode.LinkDestinationNotFound));
Assert.That(file.ValidateNoBrokenLinks(false, issues, false), Is.False);
Assert.That(2, Is.EqualTo(issues.Issues.WarningsOrErrorsOnly().Count()));
Assert.That(issues.Issues.Any(i => i.Code == ValidationErrorCode.MissingLinkSourceId));
Assert.That(issues.Issues.Any(i => i.Code == ValidationErrorCode.LinkDestinationNotFound));
}
}

Expand Down
10 changes: 5 additions & 5 deletions ApiDoctor.Validation.UnitTests/HttpParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class HttpParserTests
public void ParseOdataUrl(string odataUrl, string actualUrl)
{
var request = HttpParser.ParseHttpRequest(odataUrl);
Assert.AreEqual(actualUrl, request.Url, "Parsed Url should be equal to request header url");
Assert.That(actualUrl, Is.EqualTo(request.Url), "Parsed Url should be equal to request header url");
}

[Test]
Expand All @@ -27,7 +27,7 @@ public void ParseOdataUrl(string odataUrl, string actualUrl)
public void HttpVersionShouldBeRespected(string odataUrl, string httpVersion)
{
var request = HttpParser.ParseHttpRequest(odataUrl);
Assert.AreEqual(httpVersion, request.HttpVersion, "When HttpVersion is specified, should be respected");
Assert.That(httpVersion, Is.EqualTo(request.HttpVersion), "When HttpVersion is specified, should be respected");
}

[Test]
Expand All @@ -36,15 +36,15 @@ public void HttpVersionShouldBeRespected(string odataUrl, string httpVersion)
public void HttpVersionShouldDefaultToHttp1(string odataUrl)
{
var request = HttpParser.ParseHttpRequest(odataUrl);
Assert.AreEqual("HTTP/1.1", request.HttpVersion, "When HttpVersion is not specified, default to HTTP/1.1");
Assert.That("HTTP/1.1", Is.EqualTo(request.HttpVersion), "When HttpVersion is not specified, default to HTTP/1.1");
}

[Test]
public void ParseHttpRequest()
{
var exampleRequest = FullHttpRequest;
var parsedRequest = HttpParser.ParseHttpRequest(exampleRequest);
Assert.NotNull(parsedRequest);
Assert.That(parsedRequest, Is.Not.Null);
}

[Test]
Expand All @@ -54,7 +54,7 @@ public void ParseHttpRequest()
public void ParseOdataMethod(string odataUrl, string method)
{
var request = HttpParser.ParseHttpRequest(odataUrl);
Assert.AreEqual(method, request.Method, "Parsed Method should be equal to request header method");
Assert.That(method, Is.EqualTo(request.Method), "Parsed Method should be equal to request header method");
}
}
}
Loading

0 comments on commit 443405b

Please sign in to comment.