Exemplo n.º 1
0
        public void Errors_Match_If_Not_Ok()
        {
            var errorUid = ConceptUrn.From("urn:leaf:concept:diag:codeset=ICD9+code=123.42");
            var cpc      = new ConceptPreflightCheck
            {
                Results = new ConceptPreflightCheckResult[]
                {
                    new ConceptPreflightCheckResult
                    {
                        Id           = Guid.NewGuid(),
                        UniversalId  = errorUid,
                        IsPresent    = false,
                        IsAuthorized = false
                    },
                    new ConceptPreflightCheckResult
                    {
                        Id           = Guid.NewGuid(),
                        UniversalId  = ConceptUrn.From("urn:leaf:concept:diag:codeset=ICD9+code=123.45"),
                        IsPresent    = true,
                        IsAuthorized = true
                    }
                }
            };

            var errors = cpc.Errors();

            Assert.True(errors.Count() == 1);
            Assert.Equal(errorUid, errors.First().UniversalId, new UrnEqualityComparer());
        }
Exemplo n.º 2
0
        public void Errors_Empty_If_Ok()
        {
            var cpc = new ConceptPreflightCheck
            {
                Results = new ConceptPreflightCheckResult[]
                {
                    new ConceptPreflightCheckResult
                    {
                        Id           = Guid.NewGuid(),
                        UniversalId  = ConceptUrn.From("urn:leaf:concept:diag:codeset=ICD9+code=123.42"),
                        IsPresent    = true,
                        IsAuthorized = true
                    },
                    new ConceptPreflightCheckResult
                    {
                        Id           = Guid.NewGuid(),
                        UniversalId  = ConceptUrn.From("urn:leaf:concept:diag:codeset=ICD9+code=123.45"),
                        IsPresent    = true,
                        IsAuthorized = true
                    }
                }
            };

            var errors = cpc.Errors();

            Assert.False(errors.Any());
        }
Exemplo n.º 3
0
        public void Empty_ConceptPreflightCheck_Ok()
        {
            var check = new ConceptPreflightCheck();

            Assert.True(check.Ok);
        }
Exemplo n.º 4
0
 public void Ok_Theory(ConceptPreflightCheck cpc, bool expected)
 {
     Assert.Equal(expected, cpc.Ok);
 }
Exemplo n.º 5
0
 public ConceptPreflightCheckDTO(ConceptPreflightCheck check)
 {
     Ok      = check.Ok;
     Results = check.Results.Select(r => new ConceptPreflightCheckResultDTO(r));
 }