public void AddTest() { Fabricante item = new Fabricante() { Nome = "Fabricante01" }; IProducerRepository target = new ProducerRepository(); target.Add(item); try { // use session to try to load the product using (ISession session = NHibernateHelper.OpenSession()) { var fromDb = session.Get <Fabricante>(item.Id); Assert.IsNotNull(fromDb); Assert.AreNotSame(item, fromDb); Assert.AreEqual(item.Nome, fromDb.Nome); } } finally { target.Remove(item); } }
public static void MyClassInitialize(TestContext testContext) { item = new Fabricante() { Nome = "Fabricante01" }; IProducerRepository target = new ProducerRepository(); target.Add(item); }