Beispiel #1
0
        private void SetAnnotation(AnnotatedEvent annotatedEvent, Transitions transition)
        {
            string annotation = null;

            if (transition == Transitions.BetweenToAbove)
            {
                annotation = "true";
            }
            else if (transition == Transitions.BetweenToBelow)
            {
                annotation = "false";
            }

            annotatedEvent.SetAnnotation(0, annotation, null);
        }
Beispiel #2
0
        /// <summary>
        /// Tests the equality of two AnnotatedEvent instances.
        /// </summary>
        /// <param name="reference">Reference AnnotatedEvent.</param>
        /// <param name="actual">Actual AnnotatedEvent.</param>
        private void Equals(AnnotatedEvent reference, AnnotatedEvent actual)
        {
            Assert.IsFalse(actual == null && reference != null);
            if (reference != null)
            {
                Assert.IsNotNull(actual);
                Assert.AreEqual <DateTime>(actual.StartTime, reference.StartTime);
                Assert.AreEqual <DateTime>(actual.EndTime, reference.EndTime);
                Assert.AreEqual <TimeSpan>(actual.Duration, reference.Duration);

                Assert.IsFalse(actual.Annotations == null && reference.Annotations != null);
                if (reference.Annotations != null)
                {
                    Assert.IsNotNull(actual.Annotations);
                    Assert.AreEqual <int>(actual.Annotations.Count, reference.Annotations.Count);
                    for (int i = 0; i < actual.Annotations.Count; i++)
                    {
                        Assert.AreEqual <string>(actual.Annotations[i], reference.Annotations[i]);
                    }
                }
            }
        }