Пример #1
0
 public void TestReservePost()
 {
     //Arrange
     PostDB db = new PostDB();
     //Act
     int n= db.ReservePost(1);
     //Assert
     Assert.AreEqual(1, n);
 }
Пример #2
0
        public void TestUpdatePost()
        { //Arrange
            PostDB db = new PostDB();
            
            //Act
          int n =  db.updatePost(1, "meat", "details","7.356", "85230469", "Test124", "9685", DateTime.Today, false);

            //Assert
            Assert.AreEqual(1,n);
        }
Пример #3
0
        public void TestsavePost()
        {   //arrange
            PostDB db= new PostDB();

            //Act
            db.savePost("TestType", "TestDetails", "5.32", "85230469", "Test124", "9685", DateTime.Now, false);

            //Asert
            Assert.IsNotNull(db.findPosts("TestType"));
           // return 0;
        }
Пример #4
0
        public void TestLoadAllPosts()
        {
            // Arrange 
            PostDB db = new PostDB();
            List<Post> posts = new List<Post>();

            //Act
            posts = db.LoadAllPosts();

            // Assert
            Assert.IsTrue(posts.Count > 0);
        }
Пример #5
0
        public void TestFindPosts() { 
            //Arrange
            PostDB db = new PostDB();
            List<Post> posts= new List<Post>();
            
            //Act

           posts = db.findPosts("meat");

            //Assert

           Assert.IsTrue(posts.Count>0);
        }
Пример #6
0
 public void TestUnreserveAll() {
     PostDB db = new PostDB();
     db.unreserveAll();
 }
Пример #7
0
 public void TestExpDate() {
     PostDB db = new PostDB();
     int n= db.checkExpPosts();
     Assert.AreEqual(1, n);
 }