/// /// <summary> * set this to an event, append the Event element and optionally the comment<br/> overwrites existing values /// * </summary> /// * <param name="eventID"> Event/@EventID to set </param> /// * <param name="eventValue"> Event/@EventValue to set </param> /// * <param name="comment"> the comment text, if null no comment is set </param> /// * <returns> the newly created event </returns> /// public virtual JDFEvent setEvent(string eventID, string eventValue, string comment) { JDFEvent @event = getCreateEvent(); if (@event == null) { return(null); } @event.setEventID(eventID); @event.setEventValue(eventValue); setCommentText(comment); return(@event); }
public virtual void testsetEvent() { JDFEvent e = n.setEvent("id", "value", "bullshit"); Assert.AreEqual("id", e.getEventID()); Assert.AreEqual("value", e.getEventValue()); Assert.AreEqual("bullshit", n.getComment(0).getText()); JDFEvent ee = n.setEvent("id2", "value2", "bullshit2"); Assert.AreEqual(ee, e); e = (JDFEvent)n.getNotificationDetails(); Assert.AreEqual("id2", e.getEventID()); Assert.AreEqual("value2", e.getEventValue()); Assert.AreEqual("bullshit2", n.getComment(0).getText()); e = n.getCreateEvent(); Assert.AreEqual("id2", e.getEventID()); Assert.AreEqual("value2", e.getEventValue()); Assert.AreEqual("bullshit2", n.getComment(0).getText()); }