Skip to content

Commit 9400343

Browse files
committed
Tests - Convert BinderFacts.NullToValueType to NullToValueTypeTheory
Now uses Theory with InlineData
1 parent 99cc2d5 commit 9400343

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

CefSharp.Test/Framework/BinderFacts.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,17 @@ public void BindsDoublesWithoutPrecisionLoss()
8888
Assert.Equal(2.0, result);
8989
}
9090

91-
[Fact]
92-
public void NullToValueType()
91+
[Theory]
92+
[InlineData(0, typeof(int))]
93+
[InlineData(0d, typeof(double))]
94+
[InlineData(false, typeof(bool))]
95+
public void NullToValueTypeTheory(object excepectedResult, Type conversionType)
9396
{
9497
var binder = new DefaultBinder();
9598

96-
Assert.Equal(0, (int)binder.Bind(null, typeof(int)));
97-
Assert.Equal(0, (double)binder.Bind(null, typeof(double)));
98-
Assert.Equal(false, (bool)binder.Bind(null, typeof(bool)));
99+
var actualResult = binder.Bind(null, conversionType);
100+
101+
Assert.Equal(excepectedResult, actualResult);
99102
}
100103

101104
[Fact]

0 commit comments

Comments
 (0)