Exemplo n.º 1
0
 public static void ValidateIdPattern(string id)
 {
     if (id != null)
     {
         var tester = new Hl7.Fhir.Validation.IdPatternAttribute();
         if (!tester.IsValid(id))
         {
             throw new SparkException(HttpStatusCode.BadRequest, String.Format("{0} is not a valid value for an id", id));
         }
     }
 }
 public void InvalidPatternReturnsFalse()
 {
     var sut = new IdPatternAttribute();
     var actual = sut.IsValid("Diagnostic-example-dxa");
     Assert.IsFalse(actual, "'Diagnostic-example-dxa' should not be valid, because it contains a capital letter.");
 }