Skip to content

Commit

Permalink
Lucene.Net.Tests.Search + Lucene.Net.Tests.Support: Switched to using…
Browse files Browse the repository at this point in the history
… the Assert class in the test framework instead of NUnit (apache#295, apache#261)
  • Loading branch information
NightOwl888 committed Jun 24, 2020
1 parent 2563735 commit a5e37b9
Show file tree
Hide file tree
Showing 104 changed files with 282 additions and 211 deletions.
10 changes: 10 additions & 0 deletions src/Lucene.Net.TestFramework.NUnit/Support/TestFramework/Assert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,16 @@ public static void True(bool condition)
}


public static void LessOrEqual(int arg1, int arg2)
{
_NUnit.Assert.LessOrEqual(arg1, arg2);
}

public static void Greater(int arg1, int arg2)
{
_NUnit.Assert.Greater(arg1, arg2);
}

public static Exception Throws<TException>(Action action)
{
return Throws(typeof(TException), action);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Lucene.Net.Support;
using Lucene.Net.Util;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Analysis.Hunspell
{
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/BaseTestRangeFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using System;
using System.Text;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/FuzzyTermOnShortTermsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using System.IO;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System;
using System.IO;
using System.Text.RegularExpressions;
using Assert = Lucene.Net.TestFramework.Assert;
using Console = Lucene.Net.Util.SystemConsole;

namespace Lucene.Net.Search.Payloads
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net.Tests/Search/Similarities/TestSimilarity2.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Similarities
{
using NUnit.Framework;
using Directory = Lucene.Net.Store.Directory;

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System;
using System.Collections.Generic;
using Lucene.Net.Documents;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Similarities
{
using NUnit.Framework;
using BytesRef = Lucene.Net.Util.BytesRef;

/*
Expand Down
10 changes: 6 additions & 4 deletions src/Lucene.Net.Tests/Search/Spans/TestBasics.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
using J2N.Text;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.TokenAttributes;
using Lucene.Net.Documents;
using Lucene.Net.Index.Extensions;
using Lucene.Net.Util;
using NUnit.Framework;
using System.Collections.Generic;
using System.IO;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Spans
{
Expand All @@ -23,10 +28,7 @@ namespace Lucene.Net.Search.Spans
* limitations under the License.
*/

using Lucene.Net.Analysis;
using Lucene.Net.Util;
using NUnit.Framework;
using System.IO;

using BytesRef = Lucene.Net.Util.BytesRef;
using Directory = Lucene.Net.Store.Directory;
using Document = Documents.Document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using System.Collections.Generic;
using JCG = J2N.Collections.Generic;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Spans
{
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/Spans/TestNearSpansOrdered.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Lucene.Net.Index;
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Spans
{
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/Spans/TestPayloadSpans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using NUnit.Framework;
using System.IO;
using JCG = J2N.Collections.Generic;
using Assert = Lucene.Net.TestFramework.Assert;
using Console = Lucene.Net.Util.SystemConsole;

namespace Lucene.Net.Search.Spans
Expand Down
34 changes: 17 additions & 17 deletions src/Lucene.Net.Tests/Search/Spans/TestSpanFirstQuery.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
using Lucene.Net.Documents;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Spans
{
using NUnit.Framework;

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using Analyzer = Lucene.Net.Analysis.Analyzer;
using CharacterRunAutomaton = Lucene.Net.Util.Automaton.CharacterRunAutomaton;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Lucene.Net.Documents;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Spans
{
using NUnit.Framework;
using Directory = Lucene.Net.Store.Directory;

/*
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/Spans/TestSpans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using System.Collections.Generic;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Spans
{
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/Spans/TestSpansAdvanced.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using System;
using Assert = Lucene.Net.TestFramework.Assert;
using Console = Lucene.Net.Util.SystemConsole;

namespace Lucene.Net.Search.Spans
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/Spans/TestSpansAdvanced2.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search.Spans
{
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/TestAutomatonQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using System;
using System.Threading;
using Assert = Lucene.Net.TestFramework.Assert;
using Console = Lucene.Net.Util.SystemConsole;

namespace Lucene.Net.Search
Expand Down
3 changes: 2 additions & 1 deletion src/Lucene.Net.Tests/Search/TestAutomatonQueryUnicode.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Lucene.Net.Documents;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
using NUnit.Framework;
using Automaton = Lucene.Net.Util.Automaton.Automaton;
using Directory = Lucene.Net.Store.Directory;

Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/TestBoolean2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using System;
using Assert = Lucene.Net.TestFramework.Assert;
using Console = Lucene.Net.Util.SystemConsole;

namespace Lucene.Net.Search
Expand Down
4 changes: 2 additions & 2 deletions src/Lucene.Net.Tests/Search/TestBooleanMinShouldMatch.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System.Globalization;
using Lucene.Net.Documents;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;
using Console = Lucene.Net.Util.SystemConsole;

namespace Lucene.Net.Search
{
using Lucene.Net.Randomized.Generators;
using NUnit.Framework;
using DefaultSimilarity = Lucene.Net.Search.Similarities.DefaultSimilarity;
using Directory = Lucene.Net.Store.Directory;
using Document = Documents.Document;
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/TestBooleanOr.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using J2N.Threading.Atomic;
using Lucene.Net.Documents;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
Expand Down
14 changes: 7 additions & 7 deletions src/Lucene.Net.Tests/Search/TestBooleanQuery.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.Util;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using Lucene.Net.Documents;
using System.Threading.Tasks;
using Assert = Lucene.Net.TestFramework.Assert;
using Console = Lucene.Net.Util.SystemConsole;

namespace Lucene.Net.Search
{
using Index;
using NUnit.Framework;
using Support;
using System.Threading.Tasks;
using Util;

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -40,6 +39,7 @@ namespace Lucene.Net.Search
using IndexWriterConfig = Lucene.Net.Index.IndexWriterConfig;
using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer;
using MultiReader = Lucene.Net.Index.MultiReader;
using RandomIndexWriter = Lucene.Net.Index.RandomIndexWriter;
using SpanQuery = Lucene.Net.Search.Spans.SpanQuery;
using SpanTermQuery = Lucene.Net.Search.Spans.SpanTermQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using JCG = J2N.Collections.Generic;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
Expand Down
11 changes: 5 additions & 6 deletions src/Lucene.Net.Tests/Search/TestBooleanScorer.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
using Lucene.Net.Documents;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using Lucene.Net.Documents;
using System.Diagnostics;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
using Lucene.Net.Support;
using NUnit.Framework;
using System.Diagnostics;
using AtomicReaderContext = Lucene.Net.Index.AtomicReaderContext;
using IBits = Lucene.Net.Util.IBits;
using BooleanWeight = Lucene.Net.Search.BooleanQuery.BooleanWeight;
using Directory = Lucene.Net.Store.Directory;

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand All @@ -31,6 +29,7 @@ namespace Lucene.Net.Search

using Document = Documents.Document;
using Field = Field;
using IBits = Lucene.Net.Util.IBits;
using IndexReader = Lucene.Net.Index.IndexReader;
using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
using RandomIndexWriter = Lucene.Net.Index.RandomIndexWriter;
Expand Down
7 changes: 4 additions & 3 deletions src/Lucene.Net.Tests/Search/TestCachingCollector.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using NUnit.Framework;
using System;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
using NUnit.Framework;
using System;

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/TestCachingWrapperFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using System;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
Expand Down
1 change: 1 addition & 0 deletions src/Lucene.Net.Tests/Search/TestConjunctions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Lucene.Net.Documents;
using Lucene.Net.Index.Extensions;
using NUnit.Framework;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
Expand Down
5 changes: 3 additions & 2 deletions src/Lucene.Net.Tests/Search/TestConstantScoreQuery.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.Diagnostics;
using Lucene.Net.Documents;
using NUnit.Framework;
using System.Diagnostics;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
using NUnit.Framework;
using AtomicReaderContext = Lucene.Net.Index.AtomicReaderContext;
using DefaultSimilarity = Lucene.Net.Search.Similarities.DefaultSimilarity;
using Directory = Lucene.Net.Store.Directory;
Expand Down
5 changes: 3 additions & 2 deletions src/Lucene.Net.Tests/Search/TestCustomSearcherSort.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using Lucene.Net.Documents;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Text;
using Lucene.Net.Documents;
using JCG = J2N.Collections.Generic;
using Assert = Lucene.Net.TestFramework.Assert;
using Console = Lucene.Net.Util.SystemConsole;
using JCG = J2N.Collections.Generic;

namespace Lucene.Net.Search
{
Expand Down
5 changes: 3 additions & 2 deletions src/Lucene.Net.Tests/Search/TestDateFilter.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System;
using Lucene.Net.Attributes;
using Lucene.Net.Documents;
using NUnit.Framework;
using System;
using Assert = Lucene.Net.TestFramework.Assert;

namespace Lucene.Net.Search
{
using NUnit.Framework;
using DateTools = DateTools;
using Directory = Lucene.Net.Store.Directory;
using Document = Documents.Document;
Expand Down

0 comments on commit a5e37b9

Please sign in to comment.