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;
 }
 public BeehiveService(
     ApiaryDiaryDbContext db,
     IApiaryService apiaryService)
 {
     this.db            = db;
     this.apiaryService = apiaryService;
 }
        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());
        }
 public LocationInfoService(ApiaryDiaryDbContext db)
 {
     this.db = db;
 }