コード例 #1
0
        //[Test]
        public void TestB()
        {
            GgsTeste cat = new GgsTeste();

            cat.Nome = "Teste Insert 4";

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

            NonQueryCommandsExecutor executor = new NonQueryCommandsExecutor(cat);

            executor.Execute();

            var novaCategoria = new Joke <GgsTeste>().Query()
                                .Where("nome ILIKE 'Teste%4'")
                                .Execute()[0];

            Assert.That(novaCategoria.Id, Is.EqualTo(23));
            Assert.That(novaCategoria.Nome, Is.EqualTo("Teste Insert 4"));
        }
コード例 #2
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"));
        }
コード例 #3
0
        //[Test]
        public void TestC()
        {
            GgsTeste cat = new GgsTeste();

            cat.Nome = "Gui";

            Ags ags = new Ags();

            ags.Nome = "Alana";
            ags.Ggs  = cat;

            NonQueryCommandsExecutor executor = new NonQueryCommandsExecutor(ags);

            executor.Execute();

            var novaCategoria = new Joke <Ags>().Query()
                                .Where("ags.Ggs.Nome ILIKE 'Gui'")
                                .Execute()[0];

            Assert.That(novaCategoria.Id, Is.EqualTo(14));
            Assert.That(novaCategoria.Nome, Is.EqualTo("Gui"));
        }