public async Task CreateAsync_ShouldReturnModifiedBeerStyleDTOAsync()
        {
            //Arrange
            var options = InMemory.GetOptions("CreateAsync_ShouldReturnModifiedBeerStyleDTOAsync");

            using (var context = new BOContext(options))
            {
            }

            using (var context = new BOContext(options))
            {
                var styleDTO = new BeerStyleDTO()
                {
                    Name        = "Ale",
                    Description = "This description"
                };
                //Act
                var sut    = new BeerStylesService(context);
                var result = await sut.CreateAsync(styleDTO);

                var dbresult = await context.BeerStyles.FirstOrDefaultAsync(c => c.Name == "Ale");

                //Assert
                Assert.AreEqual(result.ID, dbresult.ID);
                Assert.AreEqual(result.Name, dbresult.Name);
            }
        }
        public async Task CreateAsync_ShouldReturnNullIfStyleInputNullAsync()
        {
            //Arrange
            var options = InMemory.GetOptions("CreateAsync_ShouldReturnNullIfStyleInputNullAsync");

            using (var context = new BOContext(options))
            {
            }

            using (var context = new BOContext(options))
            {
                //Act
                var sut    = new BeerStylesService(context);
                var result = await sut.CreateAsync(null);

                //Assert
                Assert.AreEqual(result, null);
            }
        }
        public async Task CreateAsync_ShouldUndeleteStyleRecordIfExist()
        {
            //Arrange
            var options = InMemory.GetOptions("CreateAsync_ShouldUndeleteStyleRecordIfExist");

            using (var context = new BOContext(options))
            {
                var style = new BeerStyle()
                {
                    Name        = "Ale",
                    Description = "This description",
                    DeletedOn   = DateTime.UtcNow,
                    IsDeleted   = true
                };
                context.BeerStyles.Add(style);
                await context.SaveChangesAsync();
            }

            using (var context = new BOContext(options))
            {
                var styleDTO = new BeerStyleDTO()
                {
                    Name        = "Ale",
                    Description = "This description"
                };
                //Act
                var sut = new BeerStylesService(context);
                await sut.CreateAsync(styleDTO);

                var dbresult = await context.BeerStyles.FirstOrDefaultAsync(c => c.Name == "Ale");

                //Assert
                Assert.AreEqual(dbresult.Name, "Ale");
                Assert.AreEqual(dbresult.DeletedOn, null);
                Assert.AreEqual(dbresult.IsDeleted, false);
            }
        }
        public async Task CreateAsync_ShouldReturnBeerStyleDTOAsync()
        {
            //Arrange
            var options = InMemory.GetOptions("CreateAsync_ShouldReturnBeerStyleDTOAsync");

            using (var context = new BOContext(options))
            {
            }

            using (var context = new BOContext(options))
            {
                var styleDTO = new BeerStyleDTO()
                {
                    Name        = "Ale",
                    Description = "This description"
                };
                //Act
                var sut    = new BeerStylesService(context);
                var result = await sut.CreateAsync(styleDTO);

                //Assert
                Assert.IsInstanceOfType(result, typeof(BeerStyleDTO));
            }
        }
        public async Task CreateAsync_ShouldUndeleteBeerRecordIfExist()
        {
            //Arrange
            var options = InMemory.GetOptions("CreateAsync_ShouldUndeleteBeerRecordIfExist");

            using (var context = new BOContext(options))
            {
                var country = new Country()
                {
                    Name      = "Bulgaria",
                    Breweries = new List <Brewery>()
                    {
                        new Brewery()
                        {
                            Name = "Brewery",
                        }
                    }
                };
                context.Countries.Add(country);
                await context.SaveChangesAsync();

                var beer = new Beer()
                {
                    Name      = "Carlsberg",
                    ABV       = 5,
                    Country   = await context.Countries.FirstOrDefaultAsync(c => c.Name == "Bulgaria"),
                    Brewery   = await context.Breweries.FirstOrDefaultAsync(b => b.Name == "Brewery"),
                    DeletedOn = DateTime.UtcNow,
                    IsDeleted = true,
                    Style     = new BeerStyle()
                    {
                        Name        = "Ale",
                        Description = "Some description",
                        DeletedOn   = DateTime.UtcNow,
                        IsDeleted   = true
                    },
                    Rating = 5
                };
                context.Beers.Add(beer);
                await context.SaveChangesAsync();
            }

            using (var context = new BOContext(options))
            {
                var styleDTO = new BeerStyleDTO()
                {
                    Name        = "Ale",
                    Description = "This description"
                };
                //Act
                var sut = new BeerStylesService(context);
                await sut.CreateAsync(styleDTO);

                var dbresult = await context.BeerStyles.FirstOrDefaultAsync(c => c.Name == "Ale");

                var dbBeerResult = await context.Beers.FirstOrDefaultAsync(b => b.StyleID == dbresult.ID);

                //Assert
                Assert.AreEqual(dbresult.Name, "Ale");
                Assert.AreEqual(dbresult.DeletedOn, null);
                Assert.AreEqual(dbresult.IsDeleted, false);
                Assert.AreEqual(dbBeerResult.Name, "Carlsberg");
                Assert.AreEqual(dbBeerResult.DeletedOn, null);
                Assert.AreEqual(dbBeerResult.IsDeleted, false);
            }
        }