예제 #1
0
        public void ParseRead_ExpectOperationOutcomeWhenNull()
        {
            var baseService = new FhirBaseStub(_nrlsApiSettings);

            var actual = baseService.ParseReadStub <Bundle>(null, "testid");

            Assert.Equal(ResourceType.OperationOutcome, actual.ResourceType);
        }
예제 #2
0
        public void ValidateResource_Invalid()
        {
            var baseService = new FhirBaseStub(_nrlsApiSettings);

            Assert.Throws <HttpFhirException>(() => {
                baseService.ValidateResourceStub("Patient");
            });
        }
        public void ParseRead_ExpectOperationOutcomeWhenNull()
        {
            var baseService = new FhirBaseStub(_nrlsApiSettings);

            Assert.Throws <HttpFhirException>(() => {
                var actual = baseService.ParseReadStub <Bundle>(null, "testid");
            });
        }
예제 #4
0
        public void ParseRead_ExpectOperationOutcomeWhenEmpty()
        {
            var organisations = new List <Organization>();

            var bundle      = FhirBundle.GetBundle(organisations);
            var baseService = new FhirBaseStub(_nrlsApiSettings);

            var actual = baseService.ParseReadStub(bundle, "testid");

            Assert.Equal(ResourceType.OperationOutcome, actual.ResourceType);
        }
        public void ParseRead_ExpectOperationOutcomeWhenEmpty()
        {
            var organisations = new List <Organization>();

            var bundle      = FhirBundle.GetBundle(organisations);
            var baseService = new FhirBaseStub(_nrlsApiSettings);

            Assert.Throws <HttpFhirException>(() => {
                var actual = baseService.ParseReadStub(bundle, "testid");
            });
        }
예제 #6
0
        public void ValidateResource_Valid()
        {
            var baseService = new FhirBaseStub(_nrlsApiSettings);

            try
            {
                baseService.ValidateResourceStub("DocumentReference");
            }
            catch (Exception ex)
            {
                Assert.True(false, "No exception expected, but got: " + ex.Message);
            }
        }
예제 #7
0
        public void ParseRead_ExpectOrganization()
        {
            var organisation = new Organization
            {
                Id   = "testid",
                Name = "TestName"
            };

            var baseService = new FhirBaseStub(_nrlsApiSettings);

            var actual = baseService.ParseReadStub(organisation, "testid");

            Assert.Equal(ResourceType.Organization, actual.ResourceType);
        }
예제 #8
0
        public void ParseRead_ExpectBundle()
        {
            var organisations = new List <Organization>
            {
                new Organization
                {
                    Id   = "testid",
                    Name = "TestName"
                }
            };

            var bundle      = FhirBundle.GetBundle(organisations);
            var baseService = new FhirBaseStub(_nrlsApiSettings);

            var actual = baseService.ParseReadStub(bundle, "testid");

            Assert.Equal(ResourceType.Bundle, actual.ResourceType);
        }