protected void Setup()
 {
     prod = new Product();
     entityType = typeof(Product);
 }
Пример #2
0
        public void AddProductToUnitTestDb()
        {
            IUnitOfWork uow = facade.GetUnitOfWork();

            Product p = new Product() { part = "01-01", descript = "tail light", list = 29.99M, priceff = DateTime.Now, fsc = "AA", nsn = "123", type = "TP", notes = "here are the notes..." };

            if (p.NoErrors)
            {
                uow.ProductRepo.Insert(p);

                uow.Commit();

                facade.ReturnUnitOfWork();

                Assert.Pass("added product to db");
            }
            else
            {
                facade.ReturnUnitOfWork();

                Assert.False(p.HasErrors);
            }
        }