From 919487452eda417c1ea16674e02a3ca17bc30630 Mon Sep 17 00:00:00 2001 From: amaitland Date: Mon, 18 May 2020 11:46:40 +1000 Subject: [PATCH] Tests - Convert BinderFacts.NullToValueType to NullToValueTypeTheory Now uses Theory with InlineData --- CefSharp.Test/Framework/BinderFacts.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CefSharp.Test/Framework/BinderFacts.cs b/CefSharp.Test/Framework/BinderFacts.cs index 268ee07c5..e40e3956d 100644 --- a/CefSharp.Test/Framework/BinderFacts.cs +++ b/CefSharp.Test/Framework/BinderFacts.cs @@ -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]