public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields() { ISegment expected = new BlgSegment { WhenToCharge = new ChargeCodeAndDate { InvocationEvent = "1" }, ChargeType = "2", AccountId = new ExtendedCompositeIdWithCheckDigit { IdNumber = "3" }, ChargeTypeReason = new CodedWithExceptions { Identifier = "4" } }; ISegment actual = new BlgSegment(); actual.FromDelimitedString("BLG|1|2|3|4"); expected.Should().BeEquivalentTo(actual); }
public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ISegment hl7Segment = new BlgSegment(); hl7Segment.FromDelimitedString("BLA|^~&|3|4|5|6"); }); }