Lucene.Net.QueryParsers.TestMultiFieldQueryParser.TestStaticMethod2 C# (CSharp) Method

TestStaticMethod2() private method

private TestStaticMethod2 ( ) : void
return void
		public virtual void  TestStaticMethod2()
		{
			string[] fields = new []{"b", "t"};
			Occur[] flags = new []{Occur.MUST, Occur.MUST_NOT};
			Query q = MultiFieldQueryParser.Parse(Util.Version.LUCENE_CURRENT, "one", fields, flags, new StandardAnalyzer(Util.Version.LUCENE_CURRENT));
			Assert.AreEqual("+b:one -t:one", q.ToString());
			
			q = MultiFieldQueryParser.Parse(Util.Version.LUCENE_CURRENT, "one two", fields, flags, new StandardAnalyzer(Util.Version.LUCENE_CURRENT));
			Assert.AreEqual("+(b:one b:two) -(t:one t:two)", q.ToString());
			
			Occur[] flags2 = new []{Occur.MUST};
			Assert.Throws<ArgumentException>(
			    () =>
			    MultiFieldQueryParser.Parse(Util.Version.LUCENE_CURRENT, "blah", fields, flags2,
			                                new StandardAnalyzer(Util.Version.LUCENE_CURRENT)));
		}