public void ThrowWhenParametersAreNull()
        {
            var options      = TestUtils.GetOptions(nameof(ThrowWhenParametersAreNull));
            var inCorrectBar = new Bar
            {
                Name        = null,
                Address     = null,
                PhoneNumber = null,
            };

            //act, assert
            using (var assertContext = new CocktailDB(options))
            {
                var sut = new BarServices(assertContext);
                Assert.ThrowsExceptionAsync <ArgumentNullException>(() => sut.CreateBarAsync(inCorrectBar));
                Assert.ThrowsExceptionAsync <ArgumentNullException>(() => sut.CreateBarAsync(null, null, null, null)
                                                                    );
            }
        }
        public void ThrowWhenBarIsNull()
        {
            var options = TestUtils.GetOptions(nameof(ThrowWhenBarIsNull));

            using (var assertContext = new CocktailDB(options))
            {
                var sut = new BarServices(assertContext);
                Assert.ThrowsExceptionAsync <ArgumentNullException>(() => sut.CreateBarAsync(null)
                                                                    );
            }
        }
        public void AddBarToDB()
        {
            var options = TestUtils.GetOptions(nameof(AddBarToDB));
            var bar     = new Bar
            {
                Id          = 1,
                Name        = "test",
                Address     = "asasas",
                PhoneNumber = "asd",
            };

            //act & assert
            using (var assertContext = new CocktailDB(options))
            {
                var sut = new BarServices(assertContext);
                sut.CreateBarAsync(bar).GetAwaiter();
                Assert.IsTrue(assertContext.Bars.Contains(bar));
            }
        }
        public void ReturnTureIfSuchBarExists()
        {
            var options = TestUtilities.GetOptions(nameof(ReturnTureIfSuchBarExists));
            var bar     = new Bar
            {
                Id          = 1,
                Name        = "test",
                Address     = "test1",
                PhoneNumber = "123",
            };

            //act & assert
            using (var assertContext = new CocktailDB(options))
            {
                var sut = new BarServices(assertContext);
                sut.CreateBarAsync(bar).GetAwaiter();
                Assert.IsTrue(sut.BarWithThatNameExists(bar.Name).GetAwaiter().GetResult());
            }
        }
        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));
            }
        }