Exemplo n.º 1
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new EcdSegment
            {
                ReferenceCommandNumber = 1,
                RemoteControlCommand   = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                ResponseRequired        = "3",
                RequestedCompletionTime = "4",
                Parameters = new Text[]
                {
                    new Text
                    {
                        Value = "5"
                    }
                }
            };

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

            Assert.Equal(expected, actual);
        }
Exemplo n.º 2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new EcdSegment
            {
                ReferenceCommandNumber = 1,
                RemoteControlCommand   = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                ResponseRequired        = "3",
                RequestedCompletionTime = "4",
                Parameters = new Text[]
                {
                    new Text
                    {
                        Value = "5"
                    }
                }
            };

            ISegment actual = new EcdSegment();

            actual.FromDelimitedString("ECD|1|2|3|4|5");

            expected.Should().BeEquivalentTo(actual);
        }
Exemplo n.º 3
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new EcdSegment();
         hl7Segment.FromDelimitedString("ECA|^~&|3|4|5|6");
     });
 }