Skip to content

Commit 15fb448

Browse files
authored
Merge pull request #3343 from FirelyTeam/dependabot/nuget/src/multi-ddc29dd156
Bump MSTest.TestFramework and Verify.MSTest
2 parents 4aa4144 + cc9e988 commit 15fb448

File tree

77 files changed

+251
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+251
-227
lines changed

src/Hl7.Fhir.ElementModel.Shared.Tests/ElementNodeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void TestAutoDeriveTypeForPolymorphicElement()
131131
// But if you leave the type out, Add() will try to determine the type
132132
obs = ElementNode.Root(_provider, "Observation");
133133
#if !NET40
134-
Assert.ThrowsException<ArgumentException>(() => obs.Add(_provider, "value", true)); // without an explicit type
134+
Assert.Throws<ArgumentException>(() => obs.Add(_provider, "value", true)); // without an explicit type
135135
#endif
136136
value = obs.Add(_provider, "value", true, "boolean"); // with an explicit type
137137
Assert.AreEqual("boolean", value.InstanceType);

src/Hl7.Fhir.ElementModel.Shared.Tests/TypedElementOnSourceNodeTests.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ public class TypedElementOnSourceNodeTests
1414
{
1515
private readonly IStructureDefinitionSummaryProvider provider = new PocoStructureDefinitionSummaryProvider();
1616

17-
[ExpectedException(typeof(StructuralTypeException), "Should have thrown on .Value as complex types can't have a value")]
1817
[TestMethod]
1918
public async Task TestExceptionComplexTypeValue()
2019
{
21-
var bundleJson = "{\"resourceType\":\"Bundle\", \"entry\":\"Invalid\"}";
22-
var bundle = await FhirJsonNode.ParseAsync(bundleJson);
23-
var typedBundle = bundle.ToTypedElement(provider, "Bundle");
20+
await Assert.ThrowsAsync<StructuralTypeException>(async () =>
21+
{
22+
var bundleJson = "{\"resourceType\":\"Bundle\", \"entry\":\"Invalid\"}";
23+
var bundle = await FhirJsonNode.ParseAsync(bundleJson);
24+
var typedBundle = bundle.ToTypedElement(provider, "Bundle");
2425

25-
var _ = typedBundle.Children("entry").First().Value;
26+
var _ = typedBundle.Children("entry").First().Value;
27+
});
2628
}
2729

2830
private SourceNode testPatient => SourceNode.Node("Patient",

src/Hl7.Fhir.STU3.Tests/ElementModel/PocoTypedElementTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void TestFpFunctions()
7474

7575
// FHIR specific function does not work for ITypedElement extension methods
7676
var data = ElementNode.ForPrimitive("hello!");
77-
Assert.ThrowsException<ArgumentException>(() => data.IsTrue("hasValue()"));
77+
Assert.Throws<ArgumentException>(() => data.IsTrue("hasValue()"));
7878
}
7979

8080
[TestMethod]

src/Hl7.Fhir.STU3.Tests/Model/ModelInfoTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,9 @@ public void TestTypeHierarchy()
226226
}
227227

228228
[TestMethod]
229-
[ExpectedException(typeof(ArgumentNullException))]
230229
public void TestCheckMinorVersionCompatibilityWithNull()
231230
{
232-
ModelInfo.CheckMinorVersionCompatibility(null);
231+
Assert.Throws<ArgumentNullException>(() => ModelInfo.CheckMinorVersionCompatibility(null));
233232
}
234233

235234
[TestMethod]

src/Hl7.Fhir.STU3.Tests/Rest/FhirClientTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,10 @@ private async Tasks.Task testReadWithFormat(BaseFhirClient client)
218218
}
219219

220220
[TestMethod, TestCategory("FhirClient"), TestCategory("IntegrationTest")]
221-
[ExpectedException(typeof(FhirOperationException))]
222221
public async Tasks.Task ReadWrongResourceTypeHttpClient()
223222
{
224223
FhirClient client = new FhirClient(testEndpoint);
225-
await testReadWrongResourceType(client);
224+
await Assert.ThrowsAsync<FhirOperationException>(async () => await testReadWrongResourceType(client));
226225
}
227226

228227
private static async Tasks.Task testReadWrongResourceType(BaseFhirClient client)
@@ -372,11 +371,10 @@ public async Tasks.Task SearchHttpClient()
372371
}
373372

374373
[TestMethod, TestCategory("FhirClient")]
375-
[ExpectedException(typeof(ArgumentException))]
376374
public async Tasks.Task SearchInvalidCriteriaHttpClient()
377375
{
378376
var client = new FhirClient(testEndpoint);
379-
await testSearchInvalidCriteria(client);
377+
await Assert.ThrowsAsync<ArgumentException>(async () => await testSearchInvalidCriteria(client));
380378
}
381379

382380
private async Tasks.Task testSearchInvalidCriteria(BaseFhirClient client)

src/Hl7.Fhir.STU3.Tests/Serialization/ResourceParsingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public void AcceptUnknownEnums()
247247
// Now, allow unknown enums and check support
248248
pser.Settings = pser.Settings with { AllowUnrecognizedEnums = true };
249249
p = pser.Deserialize<Patient>(xml2);
250-
Assert.ThrowsException<CodedValidationException>(() => p.Gender);
250+
Assert.Throws<CodedValidationException>(() => p.Gender);
251251
Assert.AreEqual("superman", p.GenderElement.JsonValue);
252252
}
253253

src/Hl7.Fhir.Serialization.Shared.Tests/ParseDemoPatientJsonUntyped.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,13 @@ public async Task CatchesUnsupportedFeatures()
185185
}
186186

187187
[TestMethod]
188-
[ExpectedException(typeof(InvalidOperationException), "Expected an InvalidOperationException about resourceType is missing.")]
189188
public async Task CatchResourceTypeMissing()
190189
{
191-
var json = "{ \"resourceType\": \"\", \"id\": \"rt1\", \"meta\": {\"lastUpdated\": \"2020-04-23T13:45:32Z\" } }";
192-
_ = await FhirJsonNodeParse(json, null);
190+
await Assert.ThrowsAsync<InvalidOperationException>(async () =>
191+
{
192+
var json = "{ \"resourceType\": \"\", \"id\": \"rt1\", \"meta\": {\"lastUpdated\": \"2020-04-23T13:45:32Z\" } }";
193+
_ = await FhirJsonNodeParse(json, null);
194+
});
193195
}
194196

195197
[TestMethod]

src/Hl7.Fhir.Serialization.Shared.Tests/RoundTripAttachments.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public void RoundTripAttachmentWithSizeOldParser()
7474
result.Should().Be(_attachmentJson);
7575
}
7676

77-
[DataTestMethod]
78-
[DynamicData(nameof(attachmentSource), DynamicDataSourceType.Method)]
77+
[TestMethod]
78+
[DynamicData(nameof(attachmentSource))]
7979
public void ParseAttachment(string input, object? expectedAttachmentSize, string? errorCode)
8080
{
8181
var options = new JsonSerializerOptions().ForFhir(ModelInfo.ModelInspector);

src/Hl7.Fhir.Serialization.Shared.Tests/RoundtripAllSerializers.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,27 @@ public class RoundtripAllSerializers
9292
private const string XML_EXAMPLE_ZIP_NAME = "examples.zip";
9393
private const string JSON_EXAMPLE_ZIP_NAME = "examples-json.zip";
9494

95-
[DynamicData(nameof(prepareExampleZipFiles), DynamicDataSourceType.Method,
95+
[DynamicData(nameof(prepareExampleZipFiles),
9696
DynamicDataDisplayName = nameof(GetTestDisplayNames))]
97-
[DataTestMethod]
97+
[TestMethod]
9898
[TestCategory("LongRunner")]
9999
public void FullRoundtripOfAllExamplesNewPocoSerializer(ZipArchiveEntry entry)
100100
{
101101
doRoundTrip(entry, NEW_POCO_ROUNDTRIPPER);
102102
}
103103

104-
[DynamicData(nameof(prepareExampleZipFiles), DynamicDataSourceType.Method,
104+
[DynamicData(nameof(prepareExampleZipFiles),
105105
DynamicDataDisplayName = nameof(GetTestDisplayNames))]
106-
[DataTestMethod]
106+
[TestMethod]
107107
[TestCategory("LongRunner")]
108108
public void FullRoundtripOfAllExamplesPocoSdProvTypedElementSerializer(ZipArchiveEntry entry)
109109
{
110110
doRoundTrip(entry, TYPEDELEM_POCOSDPROV);
111111
}
112112

113-
[DynamicData(nameof(prepareExampleZipFiles), DynamicDataSourceType.Method,
113+
[DynamicData(nameof(prepareExampleZipFiles),
114114
DynamicDataDisplayName = nameof(GetTestDisplayNames))]
115-
[DataTestMethod]
115+
[TestMethod]
116116
[TestCategory("LongRunner")]
117117
public void FullRoundtripOfAllExamplesSdProvTypedElementSerializer(ZipArchiveEntry entry)
118118
{
@@ -234,9 +234,9 @@ private static void compare(string expectedData, string actualData, string name,
234234
}
235235
}
236236

237-
[DynamicData(nameof(prepareExampleZipFiles), DynamicDataSourceType.Method,
237+
[DynamicData(nameof(prepareExampleZipFiles),
238238
DynamicDataDisplayName = nameof(GetTestDisplayNames))]
239-
[DataTestMethod]
239+
[TestMethod]
240240
[TestCategory("LongRunner")]
241241
public void TestMatchAndExactly(ZipArchiveEntry entry)
242242
{

src/Hl7.Fhir.Shared.Tests/ElementModel/PocoTypedElementTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void TestFpFunctions()
7373

7474
// FHIR specific function does not work for ITypedElement extension methods
7575
var data = ElementNode.ForPrimitive("hello!");
76-
Assert.ThrowsException<ArgumentException>(() => data.IsTrue("hasValue()"));
76+
Assert.Throws<ArgumentException>(() => data.IsTrue("hasValue()"));
7777
}
7878

7979
[TestMethod]

0 commit comments

Comments
 (0)