// @SuppressWarnings("deprecation")
        private void testBoolean(Model.Resource resource, Model.Base focus, String focusType, String expression, boolean value)
        {
            var input     = focus.ToTypedElement();
            var container = resource?.ToTypedElement();

            Assert.True(input.IsBoolean(expression, value, new EvaluationContext(container)));
        }
 private void testInvalid(Model.Resource resource, ErrorType type, String expression)
 {
     try
     {
         var resourceNav = resource.ToTypedElement();
         resourceNav.Select(expression);
         throw new Exception();
     }
     catch (FormatException)
     {
         if (type != ErrorType.Syntax)
         {
             throw new Exception();
         }
     }
     catch (InvalidCastException)
     {
         if (type != ErrorType.Semantics)
         {
             throw new Exception();
         }
     }
     catch (InvalidOperationException)
     {
         if (type != ErrorType.Semantics)
         {
             throw new Exception();
         }
     }
 }
        private void test(Model.Resource resource, String expression, IEnumerable <XElement> expected)
        {
            var tpXml = new FhirXmlSerializer().SerializeToString(resource);
            var npoco = resource.ToTypedElement();
            //       FhirPathEvaluatorTest.Render(npoco);

            IEnumerable <ITypedElement> actual = npoco.Select(expression);

            Assert.Equal(expected.Count(), actual.Count());

            expected.Zip(actual, compare).Count();
        }