コード例 #1
0
        public async Task <IActionResult> BrowseAsync()
        {
            var result = await _fuelTypeService.BrowseAsync();

            // return OK status code and all FuelTypes
            return(Ok(result));
        }
コード例 #2
0
ファイル: UnitTest.cs プロジェクト: bwilk163/GasolineApp
        public async Task Test2()
        {
            using (var context = new GasolineContext(options))
            {
                var service = new FuelTypeService(context);
                IEnumerable <FuelType> result = await service.BrowseAsync();

                // Check if FuelType was added
                Assert.Single(result.ToList());
            }
        }
コード例 #3
0
ファイル: UnitTest.cs プロジェクト: bwilk163/GasolineApp
        public async Task Test4()
        {
            using (var context = new GasolineContext(options))
            {
                var service = new FuelTypeService(context);
                var x       = await service.RemoveAsync(Guid.Parse("74d5aaf9-f5f1-45fe-bc79-1ab94eddb806"));

                var result = await service.BrowseAsync();

                Assert.Empty(result.ToList());
            }
        }
コード例 #4
0
ファイル: UnitTest.cs プロジェクト: bwilk163/GasolineApp
        public async Task Test1()
        {
            using (var context = new GasolineContext(options))
            {
                var x = await context.AddAsync(new Data.Models.FuelType {
                    Id = Guid.Parse("74d5aaf9-f5f1-45fe-bc79-1ab94eddb806"), FuelName = "Benzyna 95"
                });

                await context.SaveChangesAsync();
            }

            using (var context = new GasolineContext(options))
            {
                var service = new FuelTypeService(context);
                IEnumerable <FuelType> result = await service.BrowseAsync();

                // Check if FuelType was added
                Assert.Single(result.ToList());
            }
        }