public void FindMissingBt_VersionSubset() { // Set up a book where the back translation "writing systems" // in use in the revision is a subset of those in use in the book. DummyScrBook book = new DummyScrBook(); book.m_btWs = new HashSet<int>(new int[] { 1, 2, 3 }); DummyScrBook savedVersion = new DummyScrBook(); savedVersion.m_btWs = new HashSet<int>(new int[] { 1 }); // Determine writing systems in use in the book, but not in its revision. HashSet<int> missingBts = (HashSet<int>)ReflectionHelper.GetResult(book, "FindMissingBts", savedVersion); // We expect that there would be two missing writing systems in the revision. Assert.IsNotNull(missingBts); Assert.AreEqual(2, missingBts.Count); Assert.IsTrue(missingBts.Contains(2)); Assert.IsTrue(missingBts.Contains(3)); }
public void FindMissingBt_CurrentSubset() { // Set up a book and a revision of it where the back translation "writing systems" // in use in Genesis is a subset of those in use in the revision. DummyScrBook book = new DummyScrBook(); book.m_btWs = new HashSet<int>(new int[] { 1 }); DummyScrBook savedVersion = new DummyScrBook(); savedVersion.m_btWs = new HashSet<int>(new int[] { 1, 2, 3 }); // Determine writing systems in use in the book, but not in its revision. HashSet<int> missingBts = (HashSet<int>)ReflectionHelper.GetResult(book, "FindMissingBts", savedVersion); // We expect that there would be no missing writing systems in the revision. Assert.IsNull(missingBts); }
public void FindMissingBt_WsSame() { // Set up a book and a revision of it each using the same back translation // "writing system". DummyScrBook book = new DummyScrBook(); book.m_btWs = new HashSet<int>(new int[] {1}); DummyScrBook savedVersion = new DummyScrBook(); savedVersion.m_btWs = new HashSet<int>(new int[] { 1 }); // Determine writing systems in use in the book, but not in its revision. HashSet<int> missingBts = (HashSet<int>)ReflectionHelper.GetResult(book, "FindMissingBts", savedVersion); // We expect that there would be no missing writing systems in the revision. Assert.IsNull(missingBts); }