/// <summary>
        /// Inserts a genre into the repository.
        /// </summary>
        /// <param name="genre">The genre to insert.</param>
        public void Insert(Genre genre)
        {
            if (genre == null)
                throw new ArgumentNullException("genre");

            CurrentSession.Save(genre);
            CurrentSession.Flush();
        }
        public void ShouldRetrieveInsertedGenreAfterInsert()
        {
            var genre = new Genre {Name = "bromance"};
            _sut.Insert(genre);

            var retrieved = InMemorySession.Query<Genre>().ToArray();
            Assert.AreEqual(retrieved.Length, 1);
            Assert.AreEqual(retrieved.First().Name, genre.Name);
        }
        public void ShouldRetrievePreviouslyInsertedGenresOnGetAll()
        {
            var genre = new Genre {Name = "bromance"};
            using (var transaction = InMemorySession.BeginTransaction())
            {
                InMemorySession.Save(genre);
                transaction.Commit();
            }

            var retrieved = _sut.GetAll().ToArray();
            Assert.AreEqual(retrieved.Length, 1);
            Assert.AreEqual(retrieved.First().Name, genre.Name);
        }