public void ReturnCorrectBar()
        {
            var options = TestUtils.GetOptions(nameof(ReturnCorrectBar));

            var testBar = new Bar
            {
                Id          = 1,
                Name        = "Test",
                Address     = "Test",
                PhoneNumber = "Test",
            };

            // Act
            using (var actContext = new CocktailDB(options))
            {
                var sut = new BarServices(actContext);
                actContext.Bars.Add(testBar);
                actContext.SaveChangesAsync().GetAwaiter();
            }
            // Assert
            using (var assertContext = new CocktailDB(options))
            {
                var id     = 1;
                var sut    = new BarServices(assertContext);
                var result = sut.GetBarAsync(id).GetAwaiter().GetResult();
                Assert.IsTrue(assertContext.Bars.Contains(testBar));
                Assert.AreEqual(testBar.Id, result.Id);
            }
        }
        public void CorrectlyEditBar()
        {
            var options           = TestUtils.GetOptions(nameof(CorrectlyEditBar));
            var resultName        = "test1";
            var resultAddress     = "Mill Street";
            var resultPhoneNumber = "testNumber";
            var bar = new Bar
            {
                Id          = 1,
                Name        = "asd",
                Address     = "asd",
                PhoneNumber = "add",
                IsHidden    = false,
            };

            using (var actContext = new CocktailDB(options))
            {
                var sut = new BarServices(actContext);
                actContext.Bars.AddAsync(bar).GetAwaiter();
                actContext.SaveChangesAsync().GetAwaiter();
                sut.EditBarAsync(bar, resultName, resultAddress, resultPhoneNumber, null, true).GetAwaiter();
            }
            using (var asertContext = new CocktailDB(options))
            {
                var sut       = new BarServices(asertContext);
                var resultBar = sut.GetBarAsync(bar.Id).GetAwaiter().GetResult();
                Assert.AreEqual(resultBar.Name, resultName);
                Assert.AreEqual(resultBar.Address, resultAddress);
                Assert.AreEqual(resultBar.PhoneNumber, resultPhoneNumber);
                Assert.IsTrue(resultBar.IsHidden);
            }
        }
        public void ThrowWhenIdNotFound()
        {
            var options = TestUtils.GetOptions(nameof(ThrowWhenIdNotFound));

            var testBar = new Bar
            {
                Name        = "Test",
                Address     = "Test",
                PhoneNumber = "Test",
            };

            // Act, Assert
            using (var assertContext = new CocktailDB(options))
            {
                var sut = new BarServices(assertContext);

                sut.CreateBarAsync(testBar).GetAwaiter();
                Assert.ThrowsExceptionAsync <ArgumentNullException>(() => sut.GetBarAsync(int.MaxValue));
            }
        }