public void TestParseBindableUri()
        {
            var iu   = new Model.FhirUri("http://somewhere.org");
            var node = iu.ToTypedElement();
            var c    = node.ParseBindable() as Code;

            Assert.NotNull(c);
            Assert.Equal(iu.Value, c.Value);
        }
        public void TestParseBindableUri()
        {
            var iu  = new Model.FhirUri("http://somewhere.org");
            var nav = new PocoNavigator(iu);
            var c   = nav.ParseBindable() as Code;

            Assert.NotNull(c);
            Assert.Equal(iu.Value, c.Value);
        }
Example #3
0
        public void TestParseBindable()
        {
            var ic  = new Code("code");
            var nav = new PocoNavigator(ic);
            var c   = nav.ParseBindable(FHIRDefinedType.Code) as Coding;

            Assert.NotNull(c);
            Assert.Equal(ic.Value, c.Code);
            Assert.Null(c.System);

            var iq = new Model.Quantity(4.0m, "kg");

            nav = new PocoNavigator(iq);
            c   = nav.ParseBindable(FHIRDefinedType.Quantity) as Coding;
            Assert.NotNull(c);
            Assert.Equal(iq.Code, c.Code);
            Assert.Equal(iq.System, c.System);

            var ist = new Model.FhirString("Ewout");

            nav = new PocoNavigator(ist);
            c   = nav.ParseBindable(FHIRDefinedType.String) as Coding;
            Assert.NotNull(c);
            Assert.Equal(ist.Value, c.Code);
            Assert.Null(c.System);

            var iu = new Model.FhirUri("http://somewhere.org");

            nav = new PocoNavigator(iu);
            c   = nav.ParseBindable(FHIRDefinedType.Uri) as Coding;
            Assert.NotNull(c);
            Assert.Equal(iu.Value, c.Code);
            Assert.Null(c.System);

            // 'code','Coding','CodeableConcept','Quantity','Extension', 'string', 'uri'
        }