/* * Invokes the specified scanner method and verifies the scanned value with the specified expected value. */ private void assertEquals <T>(string name, T expected, ScanMethod <T> scan, EqualsMethod <T> equals) { WriteLine(); WriteLine("Testovaná metoda: \"{0}\"", name); T actual; WriteLine("Očekávaná hodnota: \"{0}\"", expected); try { actual = scan(); } catch (System.Exception e) { WriteLine("CHYBA: " + e.Message); errorsInMethod++; return; } if (equals(expected, actual)) { WriteLine("OK"); } else { WriteLine("FAIL - skutečná hodnota: \"{0}\"", actual); errorsInMethod++; } }
private IEnumerable <ITestRule> GetEqualsReturns(T instance, T other, bool result, string testCase) => EqualsMethod.Select( method => MethodReturns <T, bool> .InstanceMethod(method, instance, result, testCase, other));