Пример #1
0
        private void CheckConvert(object realValue, object expectedValue, bool target, EnumEqualsConverter converter)
        {
            var result = converter.Convert(realValue, realValue.GetType(), expectedValue, CultureInfo.CurrentCulture);

            if (result is bool boolean)
            {
                Assert.AreEqual(target, boolean);
            }
            else
            {
                Assert.Fail($"The result should be a boolean but actually is '{result?.GetType().Name ?? "[UNKNOWN]"}'.");
            }
        }
Пример #2
0
 private void CheckConvert <TEnum>(TEnum realValue, TEnum expectedValue, bool target, EnumEqualsConverter converter) where TEnum : Enum
 => this.CheckConvert((object)realValue, expectedValue, target, converter);