示例#1
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());
            }
        }
示例#2
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());
            }
        }
示例#3
0
        public async Task Test3()
        {
            using (var context = new GasolineContext(options))
            {
                var service = new FuelTypeService(context);
                await service.AddAsync(new Data.Models.FuelType {
                    Id = Guid.Parse("74d5aaf9-f5f1-45fe-bc79-1ab94eddb806"), FuelName = "Benzyna 95"
                });

                IEnumerable <FuelType> result = await service.BrowseByNameAsync("Benzyna");

                Assert.Single(result.ToList());
            }
        }
示例#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());
            }
        }
示例#5
0
 public GasStationService(GasolineContext context) : base(context)
 {
 }
示例#6
0
 public FuelTypeService(GasolineContext context) : base(context)
 {
 }