コード例 #1
0
        public ProductTests()
        {
            var optionsBuilder = new DbContextOptionsBuilder <ApiNetCoreContext>()
                                 .UseInMemoryDatabase(databaseName: DATABASE).Options;

            this.context = new ApiNetCoreContext(optionsBuilder);

            this.dataRepository = new ProductRepository(this.context);

            this.getProductByIdService = new GetProductByIdService(this.dataRepository);

            this.getAllProductsService = new GetAllProductsService(this.dataRepository);

            this.InitData();
        }
コード例 #2
0
 public ProductRepository(ApiNetCoreContext context)
 {
     this.context = context;
 }