void ToString(RuntimeInfo input, String expected) { String result = null; Test.IfNot.Action.ThrowsException(() => result = input.ToString(), out Exception ex); Test.If.Value.IsEqual(result, expected); }
void Equals(RuntimeInfo left, RuntimeInfo right, Boolean expected) { Boolean result = false; Test.IfNot.Action.ThrowsException(() => result = left.Equals(right), out Exception ex); Test.If.Value.IsEqual(result, expected); }
void Constructor_Throws() { RuntimeInfo info = null; Test.If.Action.ThrowsException(() => info = new RuntimeInfo((FrameworkIdentifiers)42, null), out ArgumentException argEx); Test.If.Action.ThrowsException(() => info = new RuntimeInfo(FrameworkIdentifiers.Unsupported, null), out ArgumentNullException argNullEx); }
void Constructor(FrameworkIdentifiers input1, Version input2, FrameworkIdentifiers framework, Version version) { RuntimeInfo info = null; Test.IfNot.Action.ThrowsException(() => info = new RuntimeInfo(input1, input2), out Exception ex); Test.If.Value.IsEqual(info.Framework, framework); Test.If.Value.IsEqual(info.Version, version); }
void Compare(RuntimeInfo input1, RuntimeInfo input2, Int32 expected) { IComparer <RuntimeInfo> comparer = new RuntimeInfoFeatureComparer(); Int32 result = default; Test.IfNot.Action.ThrowsException(() => result = comparer.Compare(input1, input2), out Exception ex); Test.If.Value.IsEqual(result, expected); }