private void assertDurationValue(AttributeValue attr, string value) { Assert.IsInstanceOfType(attr.getValue(), typeof(PrimitiveObjectBlock)); PrimitiveObjectBlock pob = (PrimitiveObjectBlock)attr.getValue(); Assert.IsInstanceOfType(pob.getSimpleValue(), typeof(DurationValue)); DurationValue actual = (DurationValue)pob.getSimpleValue(); DvDuration expected = new DvDuration(value); Assert.AreEqual(actual.getValue(), expected); }
protected override void ReadXmlBase(System.Xml.XmlReader reader) { base.ReadXmlBase(reader); DesignByContract.Check.Assert(reader.LocalName == "width", "Expected local name is width not " + reader.LocalName); this.width = new DvDuration(); this.width.ReadXml(reader); if (reader.LocalName == "sample_count") { this.SampleCount = reader.ReadElementContentAsInt("sample_count", RmXmlSerializer.OpenEhrNamespace); reader.MoveToContent(); } DesignByContract.Check.Assert(reader.LocalName == "math_function", "Expected local name is math_function not " + reader.LocalName); this.mathFunction = new DvCodedText(); this.mathFunction.ReadXml(reader); }
public History(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, DvDateTime origin, DvDuration period, DvDuration duration, Event <T>[] events, ItemStructure.ItemStructure summary) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit) { this.period = period; this.duration = duration; this.summary = summary; if (this.summary != null) { this.summary.Parent = this; } if (events != null) { this.events = RmFactory.LocatableList <Event <T> >(this, events); } this.origin = origin; SetAttributeDictionary(); CheckInvariants(); }
public IntervalEvent(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, DvDateTime time, T data, ItemStructure.ItemStructure state, DvDuration width, int?sampleCount, DvCodedText mathFunction) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, time, data, state) { Check.Require(width != null, "width must not be null"); Check.Require(mathFunction != null, "math_function must not be null"); this.width = width; if (sampleCount != null) { this.sampleCount = (int)sampleCount; this.sampleCountSet = true; } this.mathFunction = mathFunction; SetAttributeDictionary(); CheckInvariants(); }