Пример #1
0
        public async void GetByIdAsync_ValidId_Plant()
        {
            using (var ctx = new TestDataContext())
            {
                SeedPlants(ctx);
                var service = new PlantService(ctx);

                var plant = await service.GetByIdAsync(0);

                Assert.Null(plant);
            }
        }
Пример #2
0
        public async void GetByIdAsync_InvalidId_Plant()
        {
            using (var ctx = new TestDataContext())
            {
                SeedPlants(ctx);
                var service = new PlantService(ctx);

                var plant = await service.GetByIdAsync(0);

                Assert.IsType <Plant>(plant);
                Assert.Equal(1, plant.PlantId);
            }
        }