private DbContextMock DbContextDeleteTest()
        {
            DbContextMock dbContext = new DbContextMock("DbContextDeleteTest");

            dbContext.Add(Register());
            dbContext.SaveChanges();
            return(dbContext);
        }
Exemple #2
0
        public void Test_Update()
        {
            DbContext dbContext = new DbContextMock("TestUpdate");
            Users     user      = User();

            dbContext.Add(user);
            dbContext.SaveChanges();
            IUnitOfWork unitOfWork = new UnitOfWork(dbContext as INutritionalCalculatorContext);

            user.FirstName = "First name test edited";
            unitOfWork.Users.update(user);
            dbContext.SaveChanges();
            Assert.AreEqual(dbContext.Find <Users>(user.Id).FirstName, user.FirstName);
        }