-
Notifications
You must be signed in to change notification settings - Fork 396
Closed
Labels
Description
Describe the bug
When using UnitsNet units as values in a dynamic data set for a MSTest unit test, the value is lost when the test method is executed
To Reproduce
private static IEnumerable<object> TestArgs => new[] {
new object[]{ Length.FromMillimeters(2)}
};
[DataTestMethod]
[DynamicData(nameof(TestArgs))]
public void MyTestMethod(Length value)
{
Assert.AreEqual(Length.FromMillimeters(2), value);
}
Assert.AreEqual will fail, reporting that expected is 2mm and actual is 0m
Expected behavior
Assert.AreEqual should pass
Additional context
Not entirely sure if this is an issue with UnitsNet objects or an issue with the MSTest framework
Wojmik