Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce CodedException everywhere (R3) #1930

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common
17 changes: 7 additions & 10 deletions src/Hl7.Fhir.Core.Tests/Validation/ValidatePatient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,19 @@
* available at https://raw.githubusercontent.com/FirelyTeam/firely-net-sdk/master/LICENSE
*/

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Hl7.Fhir.Model;
using Hl7.Fhir.Serialization;
using System.Xml;
using System.Collections.Generic;
using Hl7.Fhir.Validation;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Hl7.Fhir.Model;
using System.Xml.Linq;
using System.Xml.Schema;
using System.IO;
using System.Xml;

namespace Hl7.Fhir.Tests.Validation
{
[TestClass]
public class ValidatePatient
public class ValidatePatient
{
[TestMethod]
public void ValidateDemoPatient()
Expand All @@ -32,7 +29,7 @@ public void ValidateDemoPatient()

ICollection<ValidationResult> results = new List<ValidationResult>();

foreach (var contained in patient.Contained) ((DomainResource)contained).Text = new Narrative() { Div = "<wrong />" };
foreach (var contained in patient.Contained) ((DomainResource)contained).Text = new Narrative() { Div = "<wrong />", Status = Narrative.NarrativeStatus.Generated };

Assert.IsFalse(DotNetAttributeValidation.TryValidate(patient, results, true));
Assert.IsTrue(results.Count > 0);
Expand All @@ -46,7 +43,7 @@ public void ValidateDemoPatient()
patient.Identifier[0].System = "urn:oid:crap really not valid";

results = new List<ValidationResult>();

Assert.IsFalse(DotNetAttributeValidation.TryValidate(patient, results, true));
Assert.IsTrue(results.Count > 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Hl7.Fhir.Core.Tests/Validation/ValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void ValidatesResourceTag()
Assert.IsFalse(DotNetAttributeValidation.TryValidate(p, recurse: true));
}

private static void validateErrorOrFail(object instance, bool recurse = false, string membername = null)
private static void validateErrorOrFail(Base instance, bool recurse = false, string membername = null)
{
try
{
Expand Down