Ejemplo n.º 1
0
        public void CompareToOperatorWithEqualObjects()
        {
            var    first  = new ScheduleElementId();
            object second = first.Clone();

            Assert.AreEqual(0, first.CompareTo(second));
        }
Ejemplo n.º 2
0
        public void CompareToWithUnequalObjectTypes()
        {
            ScheduleElementId first  = new ScheduleElementId();
            object            second = new object();

            Assert.Throws <ArgumentException>(() => first.CompareTo(second));
        }
Ejemplo n.º 3
0
        public void Clone()
        {
            ScheduleElementId first  = new ScheduleElementId();
            ScheduleElementId second = first.Clone();

            Assert.AreEqual(first, second);
        }
Ejemplo n.º 4
0
        public void CompareToWithNullObject()
        {
            ScheduleElementId first  = new ScheduleElementId();
            object            second = null;

            Assert.AreEqual(1, first.CompareTo(second));
        }
Ejemplo n.º 5
0
        public void SmallerThanOperatorWithEqualObjects()
        {
            var first  = new ScheduleElementId();
            var second = first.Clone();

            Assert.IsFalse(first < second);
        }
Ejemplo n.º 6
0
        public void SmallerThanOperatorWithBothObjectsNull()
        {
            ScheduleElementId first  = null;
            ScheduleElementId second = null;

            Assert.IsFalse(first < second);
        }
Ejemplo n.º 7
0
        public void SmallerThanOperatorWithSecondObjectNull()
        {
            ScheduleElementId first  = new ScheduleElementId();
            ScheduleElementId second = null;

            Assert.IsFalse(first < second);
        }
Ejemplo n.º 8
0
        public void LargerThanOperatorWithSecondObjectNull()
        {
            ScheduleElementId first  = new ScheduleElementId();
            ScheduleElementId second = null;

            Assert.IsTrue(first > second);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExecutingActionVertex"/> class.
        /// </summary>
        /// <param name="index">The index of the vertex in the graph.</param>
        /// <param name="actionToExecute">The ID of the action that should be executed.</param>
        public ExecutingActionVertex(int index, ScheduleElementId actionToExecute)
        {
            {
                Debug.Assert(actionToExecute != null, "The ID of the action should not be a null reference.");
            }

            Index    = index;
            m_Action = actionToExecute;
        }
Ejemplo n.º 10
0
        public void Create()
        {
            var index    = 10;
            var actionId = new ScheduleElementId();
            var vertex   = new ExecutingActionVertex(index, actionId);

            Assert.AreEqual(index, vertex.Index);
            Assert.AreSame(actionId, vertex.ActionToExecute);
        }