Esempio n. 1
0
        public void ShouldAddComment()
        {
            //arrange
            var comment = new Comments
            {
                // PostId = Guid.NewGuid(),
                PostId = Guid.Parse("4668F815-3D93-4D09-B6EB-1EA46F294F6F"),
                Text   = Guid.NewGuid().ToString().Substring(10)
            };
            //act
            var dataLayer = new DataLayer.SQL.DataLayer(ConnectionString);

            comment = dataLayer.AddComment(comment);
            //asserts
            var resultComment = dataLayer.GetComment(comment.Id);

            Assert.AreEqual(comment.Text, resultComment.Text);
        }
Esempio n. 2
0
        public void ShouldAddComment()
        {
            // arrange
            var comment = new Comment
            {
                Text   = "AddTest",
                UserId = Guid.Parse("F94A87D3-BBB1-46C9-A487-57FDE39FB38B")
            };

            var dataLayer = new DataLayer.SQL.DataLayer(_connectionString);
            // act
            var image = dataLayer.GetImage(Guid.Parse("176DCFA9-FDB7-4FAF-91CB-7E38D0C5F77C"));

            comment = dataLayer.AddCommentToImage(image.Id, comment);
            // asserts
            var resultComment = dataLayer.GetComment(comment.Id);

            Assert.AreEqual(comment.Text, resultComment.Text);
        }