Beispiel #1
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new SddSegment
            {
                LotNumber = new EntityIdentifier
                {
                    EntityId = "1"
                },
                DeviceNumber = new EntityIdentifier
                {
                    EntityId = "2"
                },
                DeviceName      = "3",
                DeviceDataState = new CodedWithExceptions
                {
                    Identifier = "4"
                },
                LoadStatus = new CodedWithExceptions
                {
                    Identifier = "5"
                },
                ControlCode  = 6,
                OperatorName = "7"
            };

            string expected = "SDD|1|2|3|4|5|6|7";
            string actual   = hl7Segment.ToDelimitedString();

            Assert.Equal(expected, actual);
        }
Beispiel #2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new SddSegment
            {
                LotNumber = new EntityIdentifier
                {
                    EntityId = "1"
                },
                DeviceNumber = new EntityIdentifier
                {
                    EntityId = "2"
                },
                DeviceName      = "3",
                DeviceDataState = new CodedWithExceptions
                {
                    Identifier = "4"
                },
                LoadStatus = new CodedWithExceptions
                {
                    Identifier = "5"
                },
                ControlCode  = 6,
                OperatorName = "7"
            };

            ISegment actual = new SddSegment();

            actual.FromDelimitedString("SDD|1|2|3|4|5|6|7");

            expected.Should().BeEquivalentTo(actual);
        }
Beispiel #3
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new SddSegment();
         hl7Segment.FromDelimitedString("SDA|^~&|3|4|5|6");
     });
 }