private void TrySetBytesRefValue(Field f) { try { f.SetBytesValue(new BytesRef("bogus")); Assert.Fail(); } catch (Exception expected) when(expected.IsIllegalArgumentException()) { // expected } }
private void TrySetBytesRefValue(Field f) { try { f.SetBytesValue(new BytesRef("bogus")); Assert.Fail(); } #pragma warning disable 168 catch (System.ArgumentException expected) #pragma warning restore 168 { // expected } }
private void TrySetBytesValue(Field f) { try { f.SetBytesValue(new byte[] { 5, 5 }); Assert.Fail(); } #pragma warning disable 168 catch (ArgumentException expected) #pragma warning restore 168 { // expected } }