public virtual void TestCTA()
 {
     NumericTokenStream stream = new NumericTokenStream();
     try
     {
         stream.AddAttribute<ICharTermAttribute>();
         Assert.Fail("Succeeded to add CharTermAttribute.");
     }
     catch (System.ArgumentException iae)
     {
         Assert.IsTrue(iae.Message.StartsWith("NumericTokenStream does not support"));
     }
     try
     {
         stream.AddAttribute<ITestAttribute>();
         Assert.Fail("Succeeded to add TestAttribute.");
     }
     catch (System.ArgumentException iae)
     {
         Assert.IsTrue(iae.Message.StartsWith("NumericTokenStream does not support"));
     }
 }
Example #2
0
        public virtual void TestCTA()
        {
            NumericTokenStream stream = new NumericTokenStream();

            try
            {
                stream.AddAttribute <ICharTermAttribute>();
                Assert.Fail("Succeeded to add CharTermAttribute.");
            }
            catch (Exception iae) when(iae.IsIllegalArgumentException())
            {
                Assert.IsTrue(iae.Message.StartsWith("NumericTokenStream does not support", StringComparison.Ordinal));
            }
            try
            {
                stream.AddAttribute <ITestAttribute>();
                Assert.Fail("Succeeded to add TestAttribute.");
            }
            catch (Exception iae) when(iae.IsIllegalArgumentException())
            {
                Assert.IsTrue(iae.Message.StartsWith("NumericTokenStream does not support", StringComparison.Ordinal));
            }
        }
        public virtual void TestCTA()
        {
            NumericTokenStream stream = new NumericTokenStream();

            try
            {
                stream.AddAttribute <ICharTermAttribute>();
                Assert.Fail("Succeeded to add CharTermAttribute.");
            }
            catch (System.ArgumentException iae)
            {
                Assert.IsTrue(iae.Message.StartsWith("NumericTokenStream does not support"));
            }
            try
            {
                stream.AddAttribute <ITestAttribute>();
                Assert.Fail("Succeeded to add TestAttribute.");
            }
            catch (System.ArgumentException iae)
            {
                Assert.IsTrue(iae.Message.StartsWith("NumericTokenStream does not support"));
            }
        }