コード例 #1
0
 public QueenBeeService(
     ApiaryDiaryDbContext db,
     IBeehiveService beehiveService)
 {
     this.db             = db;
     this.beehiveService = beehiveService;
 }
コード例 #2
0
 public InspectionService(
     ApiaryDiaryDbContext db,
     IBeehiveService beehiveService)
 {
     this.db             = db;
     this.beehiveService = beehiveService;
 }
コード例 #3
0
 public ApiaryService(
     ApiaryDiaryDbContext db,
     ILocationInfoService locationInfoService)
 {
     this.db = db;
     this.locationInfoService = locationInfoService;
 }
コード例 #4
0
 public BeehiveService(
     ApiaryDiaryDbContext db,
     IApiaryService apiaryService)
 {
     this.db            = db;
     this.apiaryService = apiaryService;
 }
コード例 #5
0
        public async Task ApiariesCountIsValid()
        {
            var options = new DbContextOptionsBuilder <ApiaryDiaryDbContext>()
                          .UseInMemoryDatabase("DbTest").Options;

            using var db = new ApiaryDiaryDbContext(options);

            var locationService = new LocationInfoService(db);
            var apiaryService   = new ApiaryService(db, locationService);

            var userId     = "dasadadadadas";
            var apiaryName = "Some appropriate name";
            var capacity   = 100;

            var apiaryId =
                await apiaryService.CreateAsync(userId, apiaryName, capacity);

            Assert.Equal(1, apiaryService.ApiariesCount());
        }
コード例 #6
0
 public LocationInfoService(ApiaryDiaryDbContext db)
 {
     this.db = db;
 }