Exemplo n.º 1
0
 public Anonymous_C9(DatabaseCodeResolverTest databaseCodeResolverTest, CodeSetDao codeSetDao, TypedCodeFactory codeFactory)
 {
     Will(Org.Jmock.Expectations
          .ReturnValue(Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.CODE));
     this.One(f_factory)
     .Create(
         this.With(Org.Jmock.Expectations
                   .Same <System.Type>(typeof(x_NormalRestrictedTabooConfidentialityKind))),
         this.With(outer_DatabaseCodeResolverTest
                   .HasSameContents(ILOG.J2CsMapping.Collections.Arrays.AsList(typeof(x_NormalRestrictedTabooConfidentialityKind)))),
         this.With(Org.Jmock.Expectations
                   .Equal <System.String>(Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.CODE_VALUE)),
         this.With(Org.Jmock.Expectations
                   .Equal <System.String>(Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.CODE_SYSTEM_OID)),
         this.With(Org.Jmock.Expectations.Any <System.Collections.Generic.IDictionary <% 1, % 2> >(typeof(IDictionary))),
         With(Org.Jmock.Expectations.Any <System.Int32?>(typeof(Int32?))),
         With(Org.Jmock.Expectations.Any <System.Boolean?>(typeof(Boolean?))),
         With(Org.Jmock.Expectations.Any <System.Boolean?>(typeof(Boolean?))));
     Will(Org.Jmock.Expectations
          .ReturnValue(outer_DatabaseCodeResolverTest
                       .CreateValueSetsCollection(new String[] { Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.CODE_VALUE })));
     this.Allowing(f_setDao).SelectValueSetsByCode(
         this.With(Org.Jmock.Expectations.Any <System.Type>(typeof(Type))),
         this.With(Org.Jmock.Expectations.Any <System.String>(typeof(String))),
         this.With(Org.Jmock.Expectations.Equal <System.String>(Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.VERSION))
         );
     outer_DatabaseCodeResolverTest = databaseCodeResolverTest;
     this.f_setDao  = codeSetDao;
     this.f_factory = codeFactory;
 }
Exemplo n.º 2
0
        /// <summary>Create a DB resolver from supplied parameters and register all found interfaces.</summary>
        /// <remarks>Create a DB resolver from supplied parameters and register all found interfaces.</remarks>
        /// <param name="dao">the code set DAO</param>
        /// <param name="codeFactory">a code factory</param>
        /// <param name="version">the value set version being used</param>
        /// <param name="registry">a code resolver registry</param>
        /// <param name="domainInterfaces">the domain interfaces to register resolvers for</param>
        private void RegisterDomainsAgainstDatabaseCodeResolver(CodeSetDao dao, TypedCodeFactory
                                                                codeFactory, string version, GenericCodeResolverRegistry registry, IList <Type> domainInterfaces)
        {
            CodeResolver dbResolver = new DatabaseCodeResolver(dao, codeFactory, version);

            foreach (Type domainInterface in domainInterfaces)
            {
                registry.RegisterResolver(domainInterface, dbResolver);
            }
        }
Exemplo n.º 3
0
 public Anonymous_C4(DatabaseCodeResolverTest databaseCodeResolverTest, CodeSetDao codeSetDao, IList <Type> list,
                     TypedCodeFactory codeFactory)
 {
     Will(Org.Jmock.Expectations
          .ReturnValue(Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.CODE));
     this.One(f_factory)
     .Create(
         this.With(Org.Jmock.Expectations
                   .Same <System.Type>(typeof(Confidentiality))),
         this.With(outer_DatabaseCodeResolverTest
                   .HasSameContents(f_list)),
         this.With(Org.Jmock.Expectations
                   .Equal <System.String>(Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.CODE_VALUE)),
         this.With(Org.Jmock.Expectations
                   .Equal <System.String>(Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.CODE_SYSTEM_OID)),
         this.With(Org.Jmock.Expectations
                   .Any <System.Collections.Generic.IDictionary <% 1, % 2> >(typeof(IDictionary))),
         With(Org.Jmock.Expectations
              .Any <System.Int32?>(typeof(Int32?))),
         With(Org.Jmock.Expectations
              .Any <System.Boolean?>(typeof(Boolean?))),
         With(Org.Jmock.Expectations
              .Any <System.Boolean?>(typeof(Boolean?))));
     Will(Org.Jmock.Expectations
          .ReturnValue(outer_DatabaseCodeResolverTest
                       .CreateValueSet(
                           Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.CODE_VALUE,
                           f_list)));
     this.Allowing(f_setDao).FindValueByCodeSystem(
         this.With(Org.Jmock.Expectations.Any <System.Type>(typeof(Type))),
         this.With(Org.Jmock.Expectations.Any <System.String>(typeof(String))),
         this.With(Org.Jmock.Expectations.Any <System.String>(typeof(String))),
         this.With(Org.Jmock.Expectations.Equal <System.String>(Ca.Infoway.Messagebuilder.Terminology.Codeset.DatabaseCodeResolverTest.VERSION))
         );
     outer_DatabaseCodeResolverTest = databaseCodeResolverTest;
     this.f_setDao  = codeSetDao;
     this.f_list    = list;
     this.f_factory = codeFactory;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Instantiates a new database c resolver.
 /// </summary>
 ///
 /// <param name="dao_0">the dao</param>
 /// <param name="codeFactory_1">the c factory</param>
 public DatabaseCodeResolver(CodeSetDao dao_0, TypedCodeFactory codeFactory_1, String version_2)
 {
     this.dao         = dao_0;
     this.codeFactory = codeFactory_1;
     this.version     = version_2;
 }
Exemplo n.º 5
0
        /// <summary>Find all domains that have value sets for the supplied version and register their matching MB interfaces against a database code resolver.
        ///     </summary>
        /// <remarks>Find all domains that have value sets for the supplied version and register their matching MB interfaces against a database code resolver.
        ///     </remarks>
        /// <param name="dao">the code set DAO</param>
        /// <param name="codeFactory">a code factory</param>
        /// <param name="version">the value set version being used</param>
        /// <param name="registry">a code resolver registry</param>
        /// <param name="releaseSpecificBasePackageName">base package name for the specific API release being targeted</param>
        /// <returns>the results of the registration process</returns>
        public virtual DatabaseCodeResolverRegistrationUtilityResults RegisterAll(CodeSetDao
                                                                                  dao, TypedCodeFactory codeFactory, string version, GenericCodeResolverRegistry
                                                                                  registry, string releaseSpecificBasePackageName)
        {
            DatabaseCodeResolverRegistrationUtilityResults results = new DatabaseCodeResolverRegistrationUtilityResults
                                                                         (this);
            ICollection <string> domainTypes      = DetermineAllDomains(dao, version);
            IList <Type>         domainInterfaces = FindAllMatchingDomainInterfaces(domainTypes, releaseSpecificBasePackageName, results);

            RegisterDomainsAgainstDatabaseCodeResolver(dao, codeFactory, version, registry, domainInterfaces);
            return(results);
        }
Exemplo n.º 6
0
 /// <summary>Create and initialize the code resolver.</summary>
 /// <remarks>Create and initialize the code resolver.</remarks>
 /// <param name="codeFactory">the code factory.</param>
 /// <param name="vocabularyDefinitionsFile">an input stream containing a list of known value sets and the codes that each contains.</param>
 /// <param name="valueSetNameMappingFile">an input stream containing the mapping from value set OIDs to interface names.</param>
 /// <param name="mode">indicates whether the resolver should return null for unexpected vocabulary domains (MODE_STRICT) or return a proxy code object (MODE_LENIENT)</param>
 public CdaCodeResolver(TypedCodeFactory codeFactory, Stream vocabularyDefinitionsFile, Stream valueSetNameMappingFile, String mode)
 {
     this.codeFactory = codeFactory;
     this.Initialize(vocabularyDefinitionsFile, valueSetNameMappingFile, mode);
 }
Exemplo n.º 7
0
 public void SetUp()
 {
     codeSetDao  = this.jmock.Mock <CodeSetDao>(typeof(CodeSetDao));
     codeFactory = this.jmock.Mock <TypedCodeFactory>(typeof(TypedCodeFactory));
     resolver    = new DatabaseCodeResolver(this.codeSetDao, this.codeFactory, VERSION);
 }