Exemplo n.º 1
0
        public void GetWithFullJoinTest()
        {
            SQLServerSession target = new SQLServerSession(GetConnection());
            ConfigurePessoa();
            ConfigureItem();

            Pessoa obj = new Pessoa(); // TODO: Initialize to an appropriate value
            obj.Id = 55;

            try {
                target.GetWithFulljoin(obj);
            } catch (Exception ex) {
                Console.Out.WriteLine(ex.StackTrace);
                throw ex;
            }
        }
Exemplo n.º 2
0
        public void GetWithFullJoinTest()
        {
            SQLServerSession target = new SQLServerSession(GetConnection());

            Pessoa obj = new Pessoa(); // TODO: Initialize to an appropriate value
            obj.Id = 55;

            try {
                target.GetWithFulljoin(obj);
                Assert.AreEqual(obj.Items.Count, 3);
            } catch (Exception ex) {
                Debug.WriteLine(ex.StackTrace);

                Assert.Fail(ex.StackTrace);
                throw ex;
            }
        }
Exemplo n.º 3
0
        public void getTest()
        {
            SQLServerSession target = new SQLServerSession(GetConnection());

            Pessoa obj = new Pessoa(); // TODO: Initialize to an appropriate value
            obj.Id = 55;

            bool expected = true;
            bool actual;
            try {
                actual = target.Get(obj);
            } catch (Exception ex) {
                throw ex;
            }

            Assert.AreEqual(expected, actual, "SimpleCrud.ADO.ADOSession.get did not return the expected value.");
        }
Exemplo n.º 4
0
        public void testDelete()
        {
            SQLServerSession session = new SQLServerSession(GetConnection());

            Pessoa pessoa = new Pessoa(); // TODO: Initialize to an appropriate value
            pessoa.Id = 100;
            session.Get(pessoa);
            pessoa.Nome += "Pessoa que vai ser alterada";
            String nome_alterado = pessoa.Nome;
            session.Insert(pessoa);
            session.Delete(pessoa);

            Assert.IsFalse(session.Get(pessoa));
        }
Exemplo n.º 5
0
        public void testUpdate()
        {
            SQLServerSession session = new SQLServerSession(GetConnection());

            Pessoa pessoa = new Pessoa(); // TODO: Initialize to an appropriate value
            pessoa.Id = 55;
            session.Get(pessoa);
            pessoa.Nome += "_alterado com sucesso";
            String nome_alterado = pessoa.Nome;
            session.Update(pessoa);
            session.Get(pessoa);
            Assert.IsTrue(nome_alterado.Trim().Equals(pessoa.Nome.Trim()));
        }
Exemplo n.º 6
0
        public void testInsert()
        {
            SQLServerSession session = new SQLServerSession(GetConnection());

            Pessoa pessoa1 = new Pessoa(); // TODO: Initialize to an appropriate value
            pessoa1.Id = 56;
            pessoa1.DataNasc = DateTime.Parse("01/12/1978");
            pessoa1.Nome = "João Da Silva Sauro";
            session.Insert(pessoa1);
            Pessoa pessoa2 = new Pessoa(); // TODO: Initialize to an appropriate value
            pessoa2.Id = 56;
            session.Get(pessoa2);
            session.Delete(pessoa2);

            Assert.IsTrue(IsPessoaEqual(pessoa1, pessoa2));
        }