public void ParseRead_ExpectOperationOutcomeWhenNull() { var baseService = new FhirBaseStub(_nrlsApiSettings); var actual = baseService.ParseReadStub <Bundle>(null, "testid"); Assert.Equal(ResourceType.OperationOutcome, actual.ResourceType); }
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"); }); }
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"); }); }
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); } }
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); }
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); }