Exemplo n.º 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"));
     }
 }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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"));
            }
        }