Ejemplo n.º 1
0
        public void ParseRead_ExpectOperationOutcomeWhenNull()
        {
            var baseService = new FhirBaseStub(_nrlsApiSettings);

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

            Assert.Equal(ResourceType.OperationOutcome, actual.ResourceType);
        }
        public void ParseRead_ExpectOperationOutcomeWhenNull()
        {
            var baseService = new FhirBaseStub(_nrlsApiSettings);

            Assert.Throws <HttpFhirException>(() => {
                var actual = baseService.ParseReadStub <Bundle>(null, "testid");
            });
        }
Ejemplo n.º 3
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");
            });
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
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);
        }