public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ISegment hl7Segment = new AilSegment(); hl7Segment.FromDelimitedString("AIA|^~&|3|4|5|6"); }); }
public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields() { ISegment expected = new AilSegment { SetIdAil = 1, SegmentActionCode = "2", LocationResourceId = new PersonLocation[] { new PersonLocation { PointOfCare = new HierarchicDesignator { NamespaceId = "3" } } }, LocationTypeAil = new CodedWithExceptions { Identifier = "4" }, LocationGroup = new CodedWithExceptions { Identifier = "5" }, StartDateTime = new DateTime(2020, 6, 6, 0, 0, 6), StartDateTimeOffset = 7, StartDateTimeOffsetUnits = new CodedWithNoExceptions { Identifier = "8" }, Duration = 9, DurationUnits = new CodedWithNoExceptions { Identifier = "10" }, AllowSubstitutionCode = new CodedWithExceptions { Identifier = "11" }, FillerStatusCode = new CodedWithExceptions { Identifier = "12" } }; ISegment actual = new AilSegment(); actual.FromDelimitedString("AIL|1|2|3|4|5|20200606000006|7|8|9|10|11|12"); expected.Should().BeEquivalentTo(actual); }
public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields() { ISegment hl7Segment = new AilSegment { SetIdAil = 1, SegmentActionCode = "2", LocationResourceId = new PersonLocation[] { new PersonLocation { PointOfCare = new HierarchicDesignator { NamespaceId = "3" } } }, LocationTypeAil = new CodedWithExceptions { Identifier = "4" }, LocationGroup = new CodedWithExceptions { Identifier = "5" }, StartDateTime = new DateTime(2020, 6, 6, 0, 0, 6), StartDateTimeOffset = 7, StartDateTimeOffsetUnits = new CodedWithNoExceptions { Identifier = "8" }, Duration = 9, DurationUnits = new CodedWithNoExceptions { Identifier = "10" }, AllowSubstitutionCode = new CodedWithExceptions { Identifier = "11" }, FillerStatusCode = new CodedWithExceptions { Identifier = "12" } }; string expected = "AIL|1|2|3|4|5|20200606000006|7|8|9|10|11|12"; string actual = hl7Segment.ToDelimitedString(); Assert.Equal(expected, actual); }