-
Notifications
You must be signed in to change notification settings - Fork 291
Closed
Milestone
Description
Summary
When the DataRowAttribute contains multiple items including at least one array, then the display name will display the type instead of unwrapping the values.
Example
public void GetDisplayNameForMultipleArraysOfOneItem()
{
// Arrange
var dataRow = new DataRowAttribute(new[] { "a" }, new[] { "1" });
var methodInfoMock = new Mock<MethodInfo>();
methodInfoMock.SetupGet(x => x.Name).Returns("MyMethod");
// Act
var displayName = dataRow.GetDisplayName(methodInfoMock.Object, dataRow.Data);
// Assert
Verify(displayName == "MyMethod (System.String[],System.String[])"); // Expecting `MyMethod ([a],[1])`
}
public void GetDisplayNameForMultipleArraysOfMultipleItems()
{
// Arrange
var dataRow = new DataRowAttribute(new[] { "a", "b", "c" }, new[] { "1", "2", "3" });
var methodInfoMock = new Mock<MethodInfo>();
methodInfoMock.SetupGet(x => x.Name).Returns("MyMethod");
// Act
var displayName = dataRow.GetDisplayName(methodInfoMock.Object, dataRow.Data);
// Assert
Verify(displayName == "MyMethod (System.String[],System.String[])"); // Expecting `MyMethod ([a,b,c],[1,2,3])`
}