mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
Tests - Convert BinderFacts.NullToValueType to NullToValueTypeTheory
Now uses Theory with InlineData
This commit is contained in:
@@ -88,14 +88,17 @@ namespace CefSharp.Test.Framework
|
||||
Assert.Equal(2.0, result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NullToValueType()
|
||||
[Theory]
|
||||
[InlineData(0, typeof(int))]
|
||||
[InlineData(0d, typeof(double))]
|
||||
[InlineData(false, typeof(bool))]
|
||||
public void NullToValueTypeTheory(object excepectedResult, Type conversionType)
|
||||
{
|
||||
var binder = new DefaultBinder();
|
||||
|
||||
Assert.Equal(0, (int)binder.Bind(null, typeof(int)));
|
||||
Assert.Equal(0, (double)binder.Bind(null, typeof(double)));
|
||||
Assert.Equal(false, (bool)binder.Bind(null, typeof(bool)));
|
||||
var actualResult = binder.Bind(null, conversionType);
|
||||
|
||||
Assert.Equal(excepectedResult, actualResult);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user