Beispiel #1
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new BlcSegment();
         hl7Segment.FromDelimitedString("BLA|^~&|3|4|5|6");
     });
 }
Beispiel #2
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new BlcSegment
            {
                BloodProductCode = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                BloodAmount = new CompositeQuantityWithUnits
                {
                    Quantity = 2
                }
            };

            string expected = "BLC|1|2";
            string actual   = hl7Segment.ToDelimitedString();

            Assert.Equal(expected, actual);
        }
Beispiel #3
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new BlcSegment
            {
                BloodProductCode = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                BloodAmount = new CompositeQuantityWithUnits
                {
                    Quantity = 2
                }
            };

            ISegment actual = new BlcSegment();

            actual.FromDelimitedString("BLC|1|2");

            expected.Should().BeEquivalentTo(actual);
        }