private void TrySetByteValue(Field f) { try { f.SetByteValue((byte)10); Assert.Fail(); } catch (Exception expected) when(expected.IsIllegalArgumentException()) { // expected } }
private void TrySetByteValue(Field f) { try { f.SetByteValue((byte)10); Assert.Fail(); } #pragma warning disable 168 catch (System.ArgumentException expected) #pragma warning restore 168 { // expected } }