public new void GetHashCode() { Action TestCase(int testNumber, DummyException exception) => () => { var testActual = new TestActual(exception); // GetHashCode() は環境によって戻り値が変わるので、例外が起こらない事だけ確認。 testActual.GetHashCode(); }; foreach (var action in new[] { TestCase(0, null), TestCase(1, new DummyException()), }) { action(); } }