private void TrySetShortValue(Field f) { try { f.SetInt16Value(short.MaxValue); Assert.Fail(); } catch (Exception expected) when(expected.IsIllegalArgumentException()) { // expected } }
private void TrySetShortValue(Field f) { try { f.SetInt16Value(short.MaxValue); Assert.Fail(); } #pragma warning disable 168 catch (System.ArgumentException expected) #pragma warning restore 168 { // expected } }