예제 #1
0
 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"));
     }
 }
예제 #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));
            }
        }
예제 #3
0
        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"));
            }
        }