Beispiel #1
0
        public void CompareToWithUnequalObjectTypes()
        {
            ScheduleId first  = new ScheduleId();
            object     second = new object();

            Assert.Throws <ArgumentException>(() => first.CompareTo(second));
        }
Beispiel #2
0
        public void CompareToWithNullObject()
        {
            ScheduleId first  = new ScheduleId();
            object     second = null;

            Assert.AreEqual(1, first.CompareTo(second));
        }
Beispiel #3
0
        public void CompareToOperatorWithEqualObjects()
        {
            var    first  = new ScheduleId();
            object second = first.Clone();

            Assert.AreEqual(0, first.CompareTo(second));
        }
Beispiel #4
0
        public void SmallerThanOperatorWithEqualObjects()
        {
            var first  = new ScheduleId();
            var second = first.Clone();

            Assert.IsFalse(first < second);
        }
Beispiel #5
0
        public void Clone()
        {
            ScheduleId first  = new ScheduleId();
            ScheduleId second = first.Clone();

            Assert.AreEqual(first, second);
        }
Beispiel #6
0
        public void SmallerThanOperatorWithBothObjectsNull()
        {
            ScheduleId first  = null;
            ScheduleId second = null;

            Assert.IsFalse(first < second);
        }
Beispiel #7
0
        public void SmallerThanOperatorWithSecondObjectNull()
        {
            ScheduleId first  = new ScheduleId();
            ScheduleId second = null;

            Assert.IsFalse(first < second);
        }
Beispiel #8
0
        public void SmallerThanOperatorWithFirstObjectNull()
        {
            ScheduleId first  = null;
            ScheduleId second = new ScheduleId();

            Assert.IsTrue(first < second);
        }
Beispiel #9
0
        public void LargerThanOperatorWithSecondObjectNull()
        {
            ScheduleId first  = new ScheduleId();
            ScheduleId second = null;

            Assert.IsTrue(first > second);
        }
Beispiel #10
0
        public void LargerThanOperatorWithFirstObjectNull()
        {
            ScheduleId first  = null;
            ScheduleId second = new ScheduleId();

            Assert.IsFalse(first > second);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ExecutingVertexEventArgs"/> class.
        /// </summary>
        /// <param name="schedule">The ID of the schedule that is currently being executed.</param>
        /// <param name="vertex">The index of the vertex that is currently being executed.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="schedule"/> is <see langword="null" />.
        /// </exception>
        public ExecutingVertexEventArgs(ScheduleId schedule, int vertex)
        {
            {
                Lokad.Enforce.Argument(() => schedule);
            }

            m_Schedule = schedule;
            m_Vertex   = vertex;
        }
Beispiel #12
0
        public void Create()
        {
            var index         = 10;
            var subScheduleId = new ScheduleId();
            var vertex        = new SubScheduleVertex(index, subScheduleId);

            Assert.AreEqual(index, vertex.Index);
            Assert.AreSame(subScheduleId, vertex.ScheduleToExecute);
        }
Beispiel #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SubScheduleVertex"/> class.
        /// </summary>
        /// <param name="index">The index of the vertex in the graph.</param>
        /// <param name="subSchedule">The ID of the schedule that should be executed.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="subSchedule"/> is <see langword="null" />.
        /// </exception>
        public SubScheduleVertex(int index, ScheduleId subSchedule)
        {
            {
                Lokad.Enforce.Argument(() => subSchedule);
            }

            Index         = index;
            m_SubSchedule = subSchedule;
        }