public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ISegment hl7Segment = new CnsSegment(); hl7Segment.FromDelimitedString("CNA|^~&|3|4|5|6"); }); }
public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields() { ISegment expected = new CnsSegment { StartingNotificationReferenceNumber = 1, EndingNotificationReferenceNumber = 2, StartingNotificationDateTime = new DateTime(2020, 3, 3, 0, 0, 3), EndingNotificationDateTime = new DateTime(2020, 4, 4, 0, 0, 4), StartingNotificationCode = new CodedWithExceptions { Identifier = "5" }, EndingNotificationCode = new CodedWithExceptions { Identifier = "6" } }; ISegment actual = new CnsSegment(); actual.FromDelimitedString("CNS|1|2|20200303000003|20200404000004|5|6"); expected.Should().BeEquivalentTo(actual); }