Beispiel #1
0
 /// <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);
 }
Beispiel #2
0
 /// <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);
 }
Beispiel #3
0
        /// <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);
            }
        }
Beispiel #4
0
		/// <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;
		}
Beispiel #5
0
		/// <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);
		}
Beispiel #6
0
		/// <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);
		}
Beispiel #7
0
		/// <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);
		}
Beispiel #8
0
		/// <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);
		}