Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DependencyConfigurationRegistry"/> class.
        /// </summary>
        public StructureMapRepositoryTestRegistry()
        {
            MockEntities.LoadData();

            For <IUserRepository>().Use(MockRepositoryGenerator <UserModel> .RepositoryMock <IUserRepository>());
            For <IUnitOfWork>().Use(MockGenerator.UnitOfWorkMock());
            For <IDataContext>().Use(MockGenerator.DataContextMock());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DependencyConfigurationRegistry"/> class.
        /// </summary>
        public StructureMapServiceTestRegistry()
        {
            MockEntities.LoadData();

            Scan(cfg =>
            {
                cfg.WithDefaultConventions();

                cfg.Assembly("SampleCode.DomainServices");
                cfg.Assembly("SampleCode.IDomainServices");
                cfg.AddAllTypesOf(typeof(IBaseService <,>));
            });

            For <IUserRepository>().Use(MockRepositoryGenerator <UserModel> .RepositoryMock <IUserRepository>());
            For <IUnitOfWork>().Use(MockGenerator.UnitOfWorkMock());
            For <IDataContext>().Use(MockGenerator.DataContextMock());
        }