Example #1
0
        public void TestCreateG()
        {
            var controller = new expenditureController();

            var result = controller.Create() as ViewResult;

            Assert.IsNotNull(result);
        }
Example #2
0
        public void TestIndex()
        {
            var db         = new AnchoiEntities();
            var controller = new expenditureController();
            var result     = controller.Index() as ViewResult;

            Assert.IsNotNull(result);
            var model = result.Model as List <expenditure>;

            Assert.AreEqual(db.expenditures.Count(),
                            (model.Count));
        }
Example #3
0
        public void TestEditG()
        {
            var controller = new expenditureController();
            var result0    = controller.Edit(0);

            Assert.IsInstanceOfType(result0, typeof(HttpNotFoundResult));
            var db      = new AnchoiEntities();
            var item    = db.expenditures.First();
            var result1 = controller.Edit(item.id) as ViewResult;

            Assert.IsNotNull(result1);
            var model = result1.Model as expenditure;

            Assert.AreEqual(item.id, model.id);
            //TMMLLLLL dit me m de an choi
        }