-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into personal/poadhikari/negative_tests_added
- Loading branch information
Showing
14 changed files
with
256 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
name: User story | ||
about: Tell us something new you want to do | ||
labels: | ||
|
||
--- | ||
|
||
**User story** | ||
As a [type of user], I want [some functionality] so that [benefit]. | ||
|
||
**Acceptance criteria** | ||
1. When I do [A], then [B] happens. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Description | ||
Describe the changes in this PR. | ||
|
||
## Related issues | ||
Addresses [issue #]. | ||
|
||
## Testing | ||
Describe how this change was tested. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
test/Microsoft.Health.Fhir.Tests.E2E/Rest/CompartmentTestFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
using Hl7.Fhir.Model; | ||
using Microsoft.Health.Fhir.Tests.Common; | ||
using Microsoft.Health.Fhir.Web; | ||
using Xunit; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace Microsoft.Health.Fhir.Tests.E2E.Rest | ||
{ | ||
public class CompartmentTestFixture : HttpIntegrationTestFixture<Startup>, IAsyncLifetime | ||
{ | ||
public Patient Patient { get; private set; } | ||
|
||
public Observation Observation { get; private set; } | ||
|
||
public Device Device { get; private set; } | ||
|
||
public DeviceComponent DeviceComponent { get; private set; } | ||
|
||
public Encounter Encounter { get; private set; } | ||
|
||
public Condition Condition { get; private set; } | ||
|
||
public async Task InitializeAsync() | ||
{ | ||
// Create various resources. | ||
Patient = await FhirClient.CreateAsync(Samples.GetJsonSample<Patient>("Patient-f001")); | ||
|
||
string patientReference = $"Patient/{Patient.Id}"; | ||
|
||
Observation observationToCreate = Samples.GetJsonSample<Observation>("Observation-For-Patient-f001"); | ||
|
||
observationToCreate.Subject.Reference = patientReference; | ||
|
||
Observation = await FhirClient.CreateAsync(observationToCreate); | ||
|
||
Encounter encounterToCreate = Samples.GetJsonSample<Encounter>("Encounter-For-Patient-f001"); | ||
|
||
encounterToCreate.Subject.Reference = patientReference; | ||
|
||
Encounter = await FhirClient.CreateAsync(encounterToCreate); | ||
|
||
Condition conditionToCreate = Samples.GetJsonSample<Condition>("Condition-For-Patient-f001"); | ||
|
||
conditionToCreate.Subject.Reference = patientReference; | ||
|
||
Condition = await FhirClient.CreateAsync(conditionToCreate); | ||
|
||
Device = await FhirClient.CreateAsync(Samples.GetJsonSample<Device>("Device-d1")); | ||
|
||
DeviceComponent deviceComponent = Samples.GetJsonSample<DeviceComponent>("DeviceComponent-For-Device-d1"); | ||
|
||
deviceComponent.Source.Reference = $"Device/{Device.Id}"; | ||
|
||
DeviceComponent = await FhirClient.CreateAsync(deviceComponent); | ||
} | ||
|
||
public Task DisposeAsync() | ||
{ | ||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
Oops, something went wrong.