Ejemplo n.º 1
0
 public void TestInsertPost()
 {
     var post = new Access.DataModels.Post
     {
         Body = "ages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the year",
         ClosedDate = DateTime.Now,
         CommentCount = 0,
         CommunityOwnedDate = DateTime.Now,
         CreationDate = DateTime.Now,
         FavoriteCount = 3,
         IsAnonymous = false,
         LastActivityDate = DateTime.Now,
         LastEditDate = DateTime.Now,
         LastEditorDisplayname = "Supun",
         LastEditorUserId = 4,
         OwnerDisplayName = "Supun",
         OwnerUserId = 5,
         ParentId = 17,
         PostTypeId = 1,
         Score = 0,
         Tags = "No Tags",
         Title = "No Title",
         ViewCount = 0
     };
     var post2 = _postDataAccess.InsertPost(post);
     Assert.IsNotNull(post2);
 }
Ejemplo n.º 2
0
 public void TestUpdatePost()
 {
     var post = new Access.DataModels.Post
     {
         Id = 14,
         Body = "their infancy. Various versions have evolved over the year",
         ClosedDate = DateTime.Now,
         CommentCount = 0,
         CommunityOwnedDate = DateTime.Now,
         CreationDate = DateTime.Now,
         FavoriteCount = 3,
         IsAnonymous = false,
         LastActivityDate = DateTime.Now,
         LastEditDate = DateTime.Now,
         LastEditorDisplayname = "Supun",
         LastEditorUserId = 4,
         OwnerDisplayName = "Supun",
         OwnerUserId = 5,
         ParentId = 0,
         PostTypeId = (int)PostTypes.FeedBack,
         Score = 0,
         Tags = "No Tags",
         Title = "No Title",
         ViewCount = 0
     };
     _postDataAccess.UpdatePost(post);
     Assert.IsNotNull(_postDataAccess.GetPost(14).Body);
 }