Пример #1
0
        public void TipoDeVeiculoRepositoryEF_InsertAndUpdate()
        {
            string incorreto = "Sedan";
            string correto   = "Sedã";

            rep.Insert(new TipoDeVeiculo()
            {
                Id = idSedan, Tipo = incorreto
            });
            var i = rep.Save();

            Assert.IsTrue(i > 0);

            var sedan = rep.Get(idSedan);

            Assert.IsNotNull(sedan);

            sedan.Tipo = correto;
            rep.Update(sedan);
            i = rep.Save();
            Assert.IsTrue(i > 0);

            var entityUpdated = rep.Get(idSedan);

            Assert.IsNotNull(entityUpdated);
            Assert.AreEqual(entityUpdated.Tipo, correto);
        }