You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using DynamicData to specify our test cases. We are creating an InvalidUpdateException object by passing custom exception message. However, the exception message being actually passed to the unit test method is “Exception of type ‘CCO.Contracts.InvalidUpdateException' was thrown.”
Steps to reproduce
private static IEnumerable<object[]> TestData()
{
return new List<object[]>()
{
new object[] { new InvalidUpdateException("Test exception message") }
};
}
[DynamicData(nameof(TestData), DynamicDataSourceType.Method)]
[TestMethod]
public void ValidateExMessage(Exception ex)
{
Assert.AreEqual(ex?.Message, "Test exception message");
}
Expected behavior
ex?.Message = "Test exception message"
Actual behavior
ex?.Message = "Exception of type ‘CCO.Contracts.InvalidUpdateException' was thrown"
Environment
Windows OS
Using Visual Studio 2022
Nuget package versions -
We are using DynamicData to specify our test cases. We are creating an InvalidUpdateException object by passing custom exception message. However, the exception message being actually passed to the unit test method is “Exception of type ‘CCO.Contracts.InvalidUpdateException' was thrown.”
Steps to reproduce
Expected behavior
Actual behavior
Environment
Windows OS
Using Visual Studio 2022
Nuget package versions -
The text was updated successfully, but these errors were encountered: