You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2020/08/26 12:06:15 UTC
[lucenenet] 02/03: Lucene.Net.Replicator: Review fixes
This is an automated email from the ASF dual-hosted git repository.
nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
commit 9f09f3b770daf55883d0d293fa111c05d6bfe497
Author: Jens Melgaard <ad...@it-links.dk>
AuthorDate: Wed Aug 26 13:54:29 2020 +0200
Lucene.Net.Replicator: Review fixes
---
src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs b/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs
index b16de7d..0007d85 100644
--- a/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs
+++ b/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs
@@ -2,10 +2,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using Lucene.Net.Attributes;
using Lucene.Net.Index;
using Lucene.Net.Replicator;
using Lucene.Net.Store;
using NUnit.Framework;
+using Assert = Lucene.Net.TestFramework.Assert;
namespace Lucene.Net.Tests.Replicator
{
@@ -31,6 +33,7 @@ namespace Lucene.Net.Tests.Replicator
{
[Test]
+ [LuceneNetSpecific]
public void Read_RemainingIndexInputLargerThanReadCount_ReturnsReadCount()
{
byte[] buffer = new byte[8.KiloBytes()];
@@ -39,10 +42,11 @@ namespace Lucene.Net.Tests.Replicator
int readBytes = 2.KiloBytes();
byte[] readBuffer = new byte[readBytes];
- Assert.That(stream.Read(readBuffer, 0, readBytes), Is.EqualTo(readBytes));
+ Assert.AreEqual(stream.Read(readBuffer, 0, readBytes), readBytes);
}
[Test]
+ [LuceneNetSpecific]
public void Read_RemainingIndexInputLargerThanReadCount_ReturnsExpectedSection([Range(1,8)]int section)
{
byte[] buffer = new byte[8.KiloBytes()];
@@ -53,8 +57,7 @@ namespace Lucene.Net.Tests.Replicator
byte[] readBuffer = new byte[readBytes];
for (int i = section; i > 0; i--)
stream.Read(readBuffer, 0, readBytes);
-
- Assert.That(readBuffer, Is.EqualTo(buffer.Skip((section-1) * readBytes).Take(readBytes).ToArray()));
+ Assert.AreEqual(readBuffer, buffer.Skip((section - 1) * readBytes).Take(readBytes).ToArray());
}
}