/// <summary> /// Check that we have the specified change. /// </summary> public void CheckChange(ChangeInformationTest c, string label) { if (IsValidChange(c)) { return; } Assert.Fail(label + ": Expected change not found " + c.Hvo + ", " + c.Tag + ", " + c.IvMin + ", " + c.CvIns + ", " + c.CvDel); }
/// <summary> /// Verify that we have the specified change. /// </summary> internal bool IsValidChange(ChangeInformationTest c) { foreach (ChangeInformationTest c2 in Changes) { if (c.Hvo == c2.Hvo && c.Tag == c2.Tag && c.IvMin == c2.IvMin && c.CvIns == c2.CvIns && c.CvDel == c2.CvDel) { return(true); } } return(false); }
/// <summary> /// This is a weaker CheckChanges, useful when there might be other changes we don't care about. /// </summary> private void CheckChanges(int hvo, int flid, int expectedIvMin, int expectedCvIns, int expectedCvDel) { var c = new ChangeInformationTest(hvo, flid, expectedIvMin, expectedCvIns, expectedCvDel); if (!m_notifiee.IsValidChange(c)) { Assert.Fail("Expected change not found: Hvo " + hvo + ", flid " + flid + ", ivMin " + expectedIvMin + ", cvIns " + expectedCvIns + ", cvDel " + expectedCvDel); } }
/// <summary> /// Verify that we have the specified change. /// </summary> internal bool IsValidChange(ChangeInformationTest c) { foreach (ChangeInformationTest c2 in Changes) { if (c.Hvo == c2.Hvo && c.Tag == c2.Tag && c.IvMin == c2.IvMin && c.CvIns == c2.CvIns && c.CvDel == c2.CvDel) return true; } return false; }
/// <summary> /// Check that we have the specified change. /// </summary> public void CheckChange(ChangeInformationTest c, string label) { if (IsValidChange(c)) return; Assert.Fail(label + ": Expected change not found " + c.Hvo + ", " + c.Tag + ", " + c.IvMin + ", " + c.CvIns + ", " + c.CvDel); }
/// <summary> /// Check that the list of changes contains all the expected changes. /// In this case, we don't care if other changes exist too. /// </summary> public void CheckChangesWeaker(ChangeInformationTest[] rgExpectedChanges, string label) { foreach (ChangeInformationTest c in rgExpectedChanges) CheckChange(c, label); }
/// <summary> /// Check that the list of changes contains all the expected changes. /// </summary> public void CheckChanges(ChangeInformationTest[] rgExpectedChanges, string label) { Assert.AreEqual(rgExpectedChanges.Length, Changes.Count, label + " wrong number of changes"); foreach (ChangeInformationTest c in rgExpectedChanges) CheckChange(c, label); }
/// <summary> /// This is a weaker CheckChanges, useful when there might be other changes we don't care about. /// </summary> private void CheckChanges(int hvo, int flid, int expectedIvMin, int expectedCvIns, int expectedCvDel) { var c = new ChangeInformationTest(hvo, flid, expectedIvMin, expectedCvIns, expectedCvDel); if (!m_notifiee.IsValidChange(c)) Assert.Fail("Expected change not found: Hvo " + hvo + ", flid " + flid + ", ivMin " + expectedIvMin + ", cvIns " + expectedCvIns +", cvDel " + expectedCvDel); }