public async Task <IActionResult> BrowseAsync()
        {
            var result = await _fuelTypeService.BrowseAsync();

            // return OK status code and all FuelTypes
            return(Ok(result));
        }
Esempio n. 2
0
        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());
            }
        }
Esempio n. 3
0
        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());
            }
        }
Esempio n. 4
0
        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());
            }
        }