コード例 #1
0
        public void InvalidFavorite1()
        {
            Favorite f = new Favorite { UserId = 1 };

            db.Favorites.Add(f);
            db.SaveChanges();
        }
コード例 #2
0
        public void InvalidFavorite2()
        {
            Favorite f = new Favorite { QuestionId = 1 };

            db.Favorites.Add(f);
            db.SaveChanges();
        }
コード例 #3
0
        public void DefaultForNewFavorite()
        {
            Favorite f = new Favorite();

            // Should not be null
            Assert.IsNotNull(f.Created_At, "Created_At should not be null");

            //Expected Default Values
            Assert.IsTrue(f.Created_At == DateTime.Now.ToString(), "Created_At should be initialized to DateTime.Now.ToString()");
        }