public static void AssertNotStructurallyEqual([CanBeNull] ZilObject notExpected, [CanBeNull] ZilObject actual) { bool ok; if (notExpected == null || actual == null) { ok = !ReferenceEquals(notExpected, actual); } else { ok = !notExpected.StructurallyEquals(actual); } if (!ok) { throw new AssertFailedException( $"{nameof(TestHelpers)}.{nameof(AssertNotStructurallyEqual)} failed. Not expected:<{notExpected}>. Actual:<{actual}>."); } }
internal static void AssertStructurallyEqual([CanBeNull] ZilObject expected, [CanBeNull] ZilObject actual, [CanBeNull] string message = null) { bool ok; if (expected == null || actual == null) { ok = ReferenceEquals(expected, actual); } else { ok = expected.StructurallyEquals(actual); } if (!ok) { message = message ?? $"{nameof(TestHelpers)}.{nameof(AssertStructurallyEqual)} failed"; throw new AssertFailedException($"{message}. Expected:<{expected}>. Actual:<{actual}>."); } }
internal static void AssertStructurallyEqual([CanBeNull] ZilObject expected, [CanBeNull] ZilObject actual, [NotNull] string format, [NotNull] params object[] args) { bool ok; if (expected == null || actual == null) { ok = ReferenceEquals(expected, actual); } else { ok = expected.StructurallyEquals(actual); } if (!ok) { var message = string.Format(format, args); throw new AssertFailedException($"{message}. Expected:<{expected}>. Actual:<{actual}>."); } }
public static ZilObject NEq_P([NotNull] Context ctx, [NotNull] ZilObject a, [NotNull] ZilObject b) { return(a.StructurallyEquals(b) ? ctx.FALSE : ctx.TRUE); }