コード例 #1
0
        public static ISalesService GetSalesService()
        {
            var options = new DbContextOptionsBuilder <StoreDbContext>()
                          .UseSqlServer(ConnectionString)
                          .Options;

            return(new SalesService(LoggerMocker.GetLogger <ISalesService>(), new UserInfo {
                Name = "mocker"
            }, new StoreDbContext(options)));
        }
コード例 #2
0
        public static ISalesBusinessObject GetSalesBusinessObject()
        {
            var logger = LoggerMocker.GetLogger <ISalesBusinessObject>();

            var userInfo = new UserInfo {
                Name = "mocker"
            };

            var appSettings = Options.Create(AppSettingsMocker.Default);

            return(new SalesBusinessObject(logger, userInfo, new StoreDbContext(appSettings, new StoreEntityMapper())));
        }
コード例 #3
0
        public static ISalesService GetSalesService()
        {
            var logger = LoggerMocker.GetLogger <ISalesService>();

            var options = new DbContextOptionsBuilder <StoreDbContext>()
                          .UseSqlServer("server=(local);database=Store;integrated security=yes;MultipleActiveResultSets=True;")
                          .Options;

            return(new SalesService(logger, new UserInfo {
                Name = "mocker"
            }, new StoreDbContext(options, new StoreEntityMapper())));
        }
コード例 #4
0
        public static IProductionService GetProductionService()
        {
            var logger = LoggerMocker.GetLogger <IProductionService>();

            var options = new DbContextOptionsBuilder <StoreDbContext>()
                          .UseSqlServer(ConnectionString)
                          .Options;

            return(new ProductionService(logger, new UserInfo {
                Name = "mocker"
            }, new StoreDbContext(options, new StoreEntityMapper())));
        }