예제 #1
0
        //[Test]
        public void ConsultaTodasAsCategoriasPrincipais()
        {
            Joke<CategoriaTeste> targetTeste = new Joke<CategoriaTeste>();
            List<CategoriaTeste> produtos = targetTeste.Query()
                .Where("id_categoria_teste = 0").Execute();

            Assert.That(produtos.Count, Is.EqualTo(27));
        }
예제 #2
0
        //[Test]
        public void ConsultaTodasAsCategoriasPrincipais()
        {
            Joke <CategoriaTeste> targetTeste = new Joke <CategoriaTeste>();
            List <CategoriaTeste> produtos    = targetTeste.Query()
                                                .Where("id_categoria_teste = 0").Execute();

            Assert.That(produtos.Count, Is.EqualTo(27));
        }
예제 #3
0
        //[Test]
        public void ConsultaCategoriaPorNome()
        {
            Joke<CategoriaTeste> targetTeste = new Joke<CategoriaTeste>();
            List<CategoriaTeste> produtos = targetTeste.Query()
                .Where("categoriaTeste.Nome = 'Arroz, Massas e Pratos Prontos'")
                .Execute();

            Assert.That(produtos.Count, Is.EqualTo(1));
        }
예제 #4
0
        //[Test]
        public void ConsultaCategoriaPorNome()
        {
            Joke <CategoriaTeste> targetTeste = new Joke <CategoriaTeste>();
            List <CategoriaTeste> produtos    = targetTeste.Query()
                                                .Where("categoriaTeste.Nome = 'Arroz, Massas e Pratos Prontos'")
                                                .Execute();

            Assert.That(produtos.Count, Is.EqualTo(1));
        }
예제 #5
0
        //[Test]
        public void ConsultaProdutosPorId()
        {
            Joke<ProdutoTeste> targetTeste = new Joke<ProdutoTeste>();

            List<ProdutoTeste> produtos = targetTeste.Query()
                .Where("produtoTeste.Id <= 10")
                .Execute();

            Assert.That(produtos.Count, Is.EqualTo(10));
        }
예제 #6
0
        //[Test]
        public void ConsultaProdutosPorId()
        {
            Joke <ProdutoTeste> targetTeste = new Joke <ProdutoTeste>();

            List <ProdutoTeste> produtos = targetTeste.Query()
                                           .Where("produtoTeste.Id <= 10")
                                           .Execute();

            Assert.That(produtos.Count, Is.EqualTo(10));
        }
예제 #7
0
        //[Test]
        public void TestA()
        {
            CategoriaTeste cat = new CategoriaTeste();

            cat.Id   = 20000;
            cat.Nome = "Teste Insert";

            var insert = new CommandInsertGenerator(cat).GetCommand();

            NonQueryCommandsExecutor executor = new NonQueryCommandsExecutor(cat);

            executor.Execute();

            var novaCategoria = target.Query()
                                .Where("categoriaTeste.Id = 20000")
                                .Execute()[0];

            Assert.That(novaCategoria.Id, Is.EqualTo(20000));
            Assert.That(novaCategoria.Nome, Is.EqualTo("Teste Insert"));
        }