From 8fb74dbabc695ceb896c5a8b7b6d66bd6426be5c Mon Sep 17 00:00:00 2001 From: Jason Boggs Date: Wed, 13 Nov 2024 12:12:05 -0600 Subject: [PATCH 1/2] add code coverage tag, simplify returns --- src/RulesEngine/Models/ImplicitObject.cs | 65 ++++++++---------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/src/RulesEngine/Models/ImplicitObject.cs b/src/RulesEngine/Models/ImplicitObject.cs index e43210e9..f65ba8fa 100644 --- a/src/RulesEngine/Models/ImplicitObject.cs +++ b/src/RulesEngine/Models/ImplicitObject.cs @@ -1,56 +1,33 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +using System.Diagnostics.CodeAnalysis; + namespace RulesEngine.Models { + [ExcludeFromCodeCoverage] public class ImplicitObject { + #region Implicit Operators - public static implicit operator ImplicitObject(bool value) - { - return default; - } - - public static implicit operator ImplicitObject(bool? value) - { - return default; - } - - public static implicit operator ImplicitObject(char value) - { - return default; - } - - public static implicit operator ImplicitObject(char? value) - { - return default; - } - - public static implicit operator ImplicitObject(string value) - { - return default; - } - - public static implicit operator ImplicitObject(int value) - { - return default; - } - - public static implicit operator ImplicitObject(int? value) - { - return default; - } - - public static implicit operator ImplicitObject(decimal value) - { - return default; - } - - public static implicit operator ImplicitObject(decimal? value) - { - return default; - } + public static implicit operator ImplicitObject(bool value) => default; + + public static implicit operator ImplicitObject(bool? value) => default; + + public static implicit operator ImplicitObject(char value) => default; + + public static implicit operator ImplicitObject(char? value) => default; + + public static implicit operator ImplicitObject(string value) => default; + + public static implicit operator ImplicitObject(int value) => default; + + public static implicit operator ImplicitObject(int? value) => default; + + public static implicit operator ImplicitObject(decimal value) => default; + + public static implicit operator ImplicitObject(decimal? value) => default; #endregion From 4a24cf5403266a635bba1037c177f0a381163e5c Mon Sep 17 00:00:00 2001 From: Jason Boggs Date: Wed, 13 Nov 2024 12:24:24 -0600 Subject: [PATCH 2/2] add float implicit conversion --- src/RulesEngine/Models/ImplicitObject.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/RulesEngine/Models/ImplicitObject.cs b/src/RulesEngine/Models/ImplicitObject.cs index f65ba8fa..41ab1cea 100644 --- a/src/RulesEngine/Models/ImplicitObject.cs +++ b/src/RulesEngine/Models/ImplicitObject.cs @@ -29,6 +29,10 @@ public class ImplicitObject public static implicit operator ImplicitObject(decimal? value) => default; + public static implicit operator ImplicitObject(float value) => default; + + public static implicit operator ImplicitObject(float? value) => default; + #endregion }