Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
halgab committed Jan 18, 2024
1 parent 21fbbbe commit 9f35661
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ public void Ctor_Type(Type contentWrapper)
public static IEnumerable<object[]> Equals_TestData()
{
var attribute = new ContentWrapperAttribute(typeof(int));
yield return new object[] { attribute, attribute, true };
yield return new object[] { attribute, new ContentWrapperAttribute(typeof(int)), true };
yield return new object[] { attribute, new ContentWrapperAttribute(typeof(string)), false };
yield return new object[] { attribute, new ContentWrapperAttribute(null), false };
yield return new object[] { new ContentWrapperAttribute(null), new ContentWrapperAttribute(null), true };
yield return new object[] { new ContentWrapperAttribute(null), new ContentWrapperAttribute(typeof(int)), false };

yield return new object[] { attribute, new object(), false };
yield return new object[] { attribute, null, false };
yield return new object?[] { attribute, attribute, true };
yield return new object?[] { attribute, new ContentWrapperAttribute(typeof(int)), true };
yield return new object?[] { attribute, new ContentWrapperAttribute(typeof(string)), false };
yield return new object?[] { attribute, new ContentWrapperAttribute(null!), false };
yield return new object?[] { new ContentWrapperAttribute(null!), new ContentWrapperAttribute(null!), true };
yield return new object?[] { new ContentWrapperAttribute(null!), new ContentWrapperAttribute(typeof(int)), false };

yield return new object?[] { attribute, new object(), false };
yield return new object?[] { attribute, null, false };
}

[Theory]
Expand All @@ -50,7 +50,7 @@ public void GetHashCode_Invoke_ReturnsExpected()
[Fact]
public void GetHashCode_InvokeNullContentWrapper_ReturnsZero()
{
var attribute = new ContentWrapperAttribute(null);
var attribute = new ContentWrapperAttribute(null!);
Assert.Equal(0, attribute.GetHashCode());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public void Ctor_Type_Type(Type loaderType, Type contentType)
[Fact]
public void Ctor_NullLoaderType_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("loaderType", () => new XamlDeferLoadAttribute(null, typeof(int)));
Assert.Throws<ArgumentNullException>("loaderType", () => new XamlDeferLoadAttribute(null!, typeof(int)));
}

[Fact]
public void Ctor_NullContentType_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("contentType", () => new XamlDeferLoadAttribute(typeof(int), null));
Assert.Throws<ArgumentNullException>("contentType", () => new XamlDeferLoadAttribute(typeof(int), null!));
}

[Theory]
Expand All @@ -48,13 +48,13 @@ public void Ctor_String_String(string loaderType, string contentType)
[Fact]
public void Ctor_NullLoaderTypeName_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("loaderType", () => new XamlDeferLoadAttribute(null, "contentType"));
Assert.Throws<ArgumentNullException>("loaderType", () => new XamlDeferLoadAttribute(null!, "contentType"));
}

[Fact]
public void Ctor_NullContentTypeName_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("contentType", () => new XamlDeferLoadAttribute("loaderType", null));
Assert.Throws<ArgumentNullException>("contentType", () => new XamlDeferLoadAttribute("loaderType", null!));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public void Ctor_String_String(string oldNamespace, string newNamespace)
[Fact]
public void Ctor_NullOldNamespace_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("oldNamespace", () => new XmlnsCompatibleWithAttribute(null, "newNamespace"));
Assert.Throws<ArgumentNullException>("oldNamespace", () => new XmlnsCompatibleWithAttribute(null!, "newNamespace"));
}

[Fact]
public void Ctor_NullNewNamespace_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("newNamespace", () => new XmlnsCompatibleWithAttribute("oldNamespace", null));
Assert.Throws<ArgumentNullException>("newNamespace", () => new XmlnsCompatibleWithAttribute("oldNamespace", null!));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public void Ctor_String_String(string xmlNamespace, string clrNamespace)
[Fact]
public void Ctor_NullXmlNamespace_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("xmlNamespace", () => new XmlnsDefinitionAttribute(null, "clrNamespace"));
Assert.Throws<ArgumentNullException>("xmlNamespace", () => new XmlnsDefinitionAttribute(null!, "clrNamespace"));
}

[Fact]
public void Ctor_NullClrNamespace_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("clrNamespace", () => new XmlnsDefinitionAttribute("xmlNamespace", null));
Assert.Throws<ArgumentNullException>("clrNamespace", () => new XmlnsDefinitionAttribute("xmlNamespace", null!));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public void Ctor_String_String(string xmlNamespace, string prefix)
[Fact]
public void Ctor_NullXmlNamespace_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("xmlNamespace", () => new XmlnsPrefixAttribute(null, "prefix"));
Assert.Throws<ArgumentNullException>("xmlNamespace", () => new XmlnsPrefixAttribute(null!, "prefix"));
}

[Fact]
public void Ctor_NullPrefix_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>("prefix", () => new XmlnsPrefixAttribute("xmlNamespace", null));
Assert.Throws<ArgumentNullException>("prefix", () => new XmlnsPrefixAttribute("xmlNamespace", null!));
}
}

0 comments on commit 9f35661

Please sign in to comment.