public void Delete()
        {
            var unitOfWork = new GameUnitOfWork();
            var service = new GameDomainService(unitOfWork);

            var game = new Game()
            {
                Name = "Delete",
                Price = 100,
                Category = GameCategory.RPG
            };

            service.Insert(game);
            unitOfWork.Commit();

            //Deve haver 1 registro (adicionado acima)
            Assert.IsTrue(service.FindByName("Delet").Count > 0);

            service.Delete(game);
            unitOfWork.Commit();

            //Nao deve haver registros
            Assert.IsTrue(service.FindByName("Delet").Count == 0);
        }
        public void Insert()
        {
            var unitOfWork = new GameUnitOfWork();
            var service = new GameDomainService(unitOfWork);

            var game = new Game()
            {
                Name = "Test",
                Price = 100,
                Category = GameCategory.RPG
            };

            service.Insert(game);
            unitOfWork.Commit();

            //Deve haver ao menos 1 game que o nome inicie com Tes
            Assert.IsTrue(service.FindByName("Tes").Count > 0);
        }
        public void FindByName()
        {
            Console.Clear();

            List<Game> list;

            var unitOfWork = new GameUnitOfWork();

            var service = new GameDomainService(unitOfWork);

            Console.WriteLine("Digite o nome a ser procurado:");
            string name = Console.ReadLine();
            list = service.FindByName(name);

            if (list == null || list.Count == 0)
            {
                Console.WriteLine("Nenhum registro encontrado!");
                return;
            }

            foreach (var game in list)
            {
                Console.WriteLine(game.ToString());
            }
        }