public void CompareToWithUnequalObjectTypes() { ScheduleId first = new ScheduleId(); object second = new object(); Assert.Throws <ArgumentException>(() => first.CompareTo(second)); }
public void CompareToWithNullObject() { ScheduleId first = new ScheduleId(); object second = null; Assert.AreEqual(1, first.CompareTo(second)); }
public void CompareToOperatorWithEqualObjects() { var first = new ScheduleId(); object second = first.Clone(); Assert.AreEqual(0, first.CompareTo(second)); }
public void SmallerThanOperatorWithEqualObjects() { var first = new ScheduleId(); var second = first.Clone(); Assert.IsFalse(first < second); }
public void Clone() { ScheduleId first = new ScheduleId(); ScheduleId second = first.Clone(); Assert.AreEqual(first, second); }
public void SmallerThanOperatorWithBothObjectsNull() { ScheduleId first = null; ScheduleId second = null; Assert.IsFalse(first < second); }
public void SmallerThanOperatorWithSecondObjectNull() { ScheduleId first = new ScheduleId(); ScheduleId second = null; Assert.IsFalse(first < second); }
public void SmallerThanOperatorWithFirstObjectNull() { ScheduleId first = null; ScheduleId second = new ScheduleId(); Assert.IsTrue(first < second); }
public void LargerThanOperatorWithSecondObjectNull() { ScheduleId first = new ScheduleId(); ScheduleId second = null; Assert.IsTrue(first > second); }
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; }
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); }
/// <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; }