diff --git a/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs index 8ce487b618..d60e6c2ecc 100644 --- a/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs +++ b/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs @@ -1,4 +1,4 @@ -using Lucene.Net.Attributes; +using Lucene.Net.Attributes; using Lucene.Net.Util; using NUnit.Framework; using System; @@ -111,7 +111,7 @@ public override void TestForPublicMembersNamedSize(Type typeFromTargetAssembly) public override void TestForPublicMembersContainingNonNetNumeric(Type typeFromTargetAssembly) { base.TestForPublicMembersContainingNonNetNumeric(typeFromTargetAssembly); - } + } [Test, LuceneNetSpecific] [TestCase(typeof(Lucene.Net.Classification.KNearestNeighborClassifier))] @@ -129,12 +129,12 @@ public override void TestForPublicMembersWithNullableEnum(Type typeFromTargetAss // LUCENENET NOTE: This test is only for identifying members who were changed from // ICollection, IList or ISet to IEnumerable during the port (that should be changed back) - //[Test, LuceneNetSpecific] - //[TestCase(typeof(Lucene.Net.Classification.KNearestNeighborClassifier))] - //public override void TestForMembersAcceptingOrReturningIEnumerable(Type typeFromTargetAssembly) - //{ - // base.TestForMembersAcceptingOrReturningIEnumerable(typeFromTargetAssembly); - //} + [Test, LuceneNetSpecific] + [TestCase(typeof(Lucene.Net.Classification.KNearestNeighborClassifier))] + public override void TestForMembersAcceptingOrReturningIEnumerable(Type typeFromTargetAssembly) + { + base.TestForMembersAcceptingOrReturningIEnumerable(typeFromTargetAssembly); + } [Test, LuceneNetSpecific] [TestCase(typeof(Lucene.Net.Classification.KNearestNeighborClassifier))] diff --git a/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs b/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs index 0f7d9eca6f..30ed545076 100644 --- a/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs +++ b/src/Lucene.Net.Tests.Classification/Utils/DataSplitterTest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using Lucene.Net.Analysis; using Lucene.Net.Classification.Utils; @@ -32,24 +32,24 @@ namespace Lucene.Net.Classification */ public class DataSplitterTest : Util.LuceneTestCase { - private AtomicReader _originalIndex; - private RandomIndexWriter _indexWriter; - private Directory _dir; + private AtomicReader originalIndex; + private RandomIndexWriter indexWriter; + private Directory dir; - private String _textFieldName = "text"; - private String _classFieldName = "class"; - private String _idFieldName = "id"; + private String textFieldName = "text"; + private String classFieldName = "class"; + private String idFieldName = "id"; [SetUp] public override void SetUp() { base.SetUp(); - _dir = NewDirectory(); - _indexWriter = new RandomIndexWriter( + dir = NewDirectory(); + indexWriter = new RandomIndexWriter( #if FEATURE_INSTANCE_TESTDATA_INITIALIZATION this, #endif - Random, _dir, new MockAnalyzer(Random)); + Random, dir, new MockAnalyzer(Random)); FieldType ft = new FieldType(TextField.TYPE_STORED); ft.StoreTermVectors = true; @@ -62,38 +62,38 @@ public override void SetUp() for (int i = 0; i < 100; i++) { doc = new Document(); - doc.Add(new Field(_idFieldName, Random.toString(), ft)); - doc.Add(new Field(_textFieldName, new StringBuilder(Random.toString()).append(Random.toString()).append( + doc.Add(new Field(idFieldName, Random.toString(), ft)); + doc.Add(new Field(textFieldName, new StringBuilder(Random.toString()).append(Random.toString()).append( Random.toString()).toString(), ft)); - doc.Add(new Field(_classFieldName, Random.toString(), ft)); - _indexWriter.AddDocument(doc, analyzer); + doc.Add(new Field(classFieldName, Random.toString(), ft)); + indexWriter.AddDocument(doc, analyzer); } - _indexWriter.Commit(); + indexWriter.Commit(); - _originalIndex = SlowCompositeReaderWrapper.Wrap(_indexWriter.GetReader()); + originalIndex = SlowCompositeReaderWrapper.Wrap(indexWriter.GetReader()); } [TearDown] public override void TearDown() { - _originalIndex.Dispose(); - _indexWriter.Dispose(); - _dir.Dispose(); + originalIndex.Dispose(); + indexWriter.Dispose(); + dir.Dispose(); base.TearDown(); } [Test] public void TestSplitOnAllFields() { - AssertSplit(_originalIndex, 0.1, 0.1); + AssertSplit(originalIndex, 0.1, 0.1); } [Test] public void TestSplitOnSomeFields() { - AssertSplit(_originalIndex, 0.2, 0.35, _idFieldName, _textFieldName); + AssertSplit(originalIndex, 0.2, 0.35, idFieldName, textFieldName); } public static void AssertSplit(AtomicReader originalIndex, double testRatio, double crossValidationRatio, params string[] fieldNames)