From a19b9d22004db9824030c2dbe498410176746302 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Tue, 16 Apr 2024 08:08:27 -0400 Subject: [PATCH] Updates from reviewer comments --- .../Corpora/ScriptureRefTests.cs | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tests/SIL.Machine.Tests/Corpora/ScriptureRefTests.cs b/tests/SIL.Machine.Tests/Corpora/ScriptureRefTests.cs index 870afced..b395fcb7 100644 --- a/tests/SIL.Machine.Tests/Corpora/ScriptureRefTests.cs +++ b/tests/SIL.Machine.Tests/Corpora/ScriptureRefTests.cs @@ -24,6 +24,10 @@ public int CompareTo_Strict(string ref1Str, string ref2Str) int result = ref1.CompareTo(ref2); + // this tests the IComparable.CompareTo method responds the same as the ScriptureRef.CompareTo method. + int result2 = ((IComparable)ref1).CompareTo(ref2); + Assert.That(result, Is.EqualTo(result2)); + if (result < 0) result = -1; else if (result > 0) @@ -51,22 +55,6 @@ public int CompareTo_Relaxed(string ref1Str, string ref2Str) return result; } - [TestCase] - public void CompareTemplate() - { - // this tests the IComparable.CompareTo method by calling Sort() on a list of ScriptureRefs - var refs = new List { ScriptureRef.Parse("MAT 1:2"), ScriptureRef.Parse("MAT 1:1") }; - refs.Sort(); - Assert.That(refs[0].ToString(), Is.EqualTo("MAT 1:1")); - var dictRefs = new HashSet - { - ScriptureRef.Parse("MAT 1:1/1:p"), - ScriptureRef.Parse("MAT 1:2/1:p"), - ScriptureRef.Parse("MAT 1:2/1:p") - }; - Assert.That(dictRefs.Count, Is.EqualTo(2)); - } - [TestCase] public void IsEqualTo() {