Example #1
0
 private void TrySetBytesRefValue(Field f)
 {
     try
     {
         f.SetBytesValue(new BytesRef("bogus"));
         Assert.Fail();
     }
     catch (Exception expected) when(expected.IsIllegalArgumentException())
     {
         // expected
     }
 }
Example #2
0
        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
            }
        }
Example #3
0
        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
            }
        }