diff --git a/src/SIL.Machine/Corpora/NParallelTextCorpus.cs b/src/SIL.Machine/Corpora/NParallelTextCorpus.cs index c8f2c904..d3df81da 100644 --- a/src/SIL.Machine/Corpora/NParallelTextCorpus.cs +++ b/src/SIL.Machine/Corpora/NParallelTextCorpus.cs @@ -12,8 +12,6 @@ public class NParallelTextCorpus : NParallelTextCorpusBase public NParallelTextCorpus(IEnumerable corpora, IComparer rowRefComparer = null) { Corpora = corpora.ToImmutableArray(); - if (Corpora.Count < 1) - throw new ArgumentException("There must be at least one corpora.", nameof(corpora)); RowRefComparer = rowRefComparer ?? new DefaultRowRefComparer(); AllRows = new bool[Corpora.Count] .Select(_ => false) diff --git a/tests/SIL.Machine.Tests/Corpora/NParallelTextCorpusTests.cs b/tests/SIL.Machine.Tests/Corpora/NParallelTextCorpusTests.cs index 68dc9f90..e07c23ce 100644 --- a/tests/SIL.Machine.Tests/Corpora/NParallelTextCorpusTests.cs +++ b/tests/SIL.Machine.Tests/Corpora/NParallelTextCorpusTests.cs @@ -6,6 +6,14 @@ namespace SIL.Machine.Corpora; [TestFixture] public class NParallelTextCorpusTests { + [Test] + public void GetRows_ZeroCorpora() + { + var nParallelCorpus = new NParallelTextCorpus([]); + NParallelTextRow[] rows = nParallelCorpus.ToArray(); + Assert.That(rows.Length, Is.EqualTo(0)); + } + [Test] public void GetRows_ThreeCorpora() {