Exemple #1
0
        public void UpdateComment(baseCommentView view)
        {
#if visual
#else
            Data.Services.CommentService svc = new Data.Services.CommentService();
            svc.UpdateComment(ConvertToModel(view));
#endif
        }
Exemple #2
0
        public baseCommentView ConvertToView(Comment item)
        {
            baseCommentView view = new baseCommentView();

            view.ID            = item.ID;
            view.Description   = item.Description;
            view.RequirementID = item.RequirementID;
            return(view);
        }
Exemple #3
0
        public Comment ConvertToModel(baseCommentView item)
        {
            Comment model = new Comment();

            model.ID            = item.ID;
            model.Description   = item.Description;
            model.RequirementID = item.RequirementID;
            return(model);
        }
Exemple #4
0
        public void ConvertToModelTest()
        {
            CommentProvider target   = new CommentProvider(); // TODO: Initialize to an appropriate value
            baseCommentView item     = _baseCommentView;
            Comment         expected = _Comment;
            Comment         actual;

            actual = target.ConvertToModel(item);
            CompareModelObject(expected, actual);
        }
Exemple #5
0
 public static void MyClassInitialize(TestContext testContext)
 {
     _baseCommentView = new baseCommentView()
     {
         Description = "Description", ID = 1, RequirementID = 1
     };                                                                                                   // TODO: Initialize to an appropriate value
     _Comment = new Comment()
     {
         Description = "Description", ID = 1, RequirementID = 1
     };
 }
Exemple #6
0
        public void GetCommentTest()
        {
            CommentProvider target   = new CommentProvider(); // TODO: Initialize to an appropriate value
            int             id       = 0;                     // TODO: Initialize to an appropriate value
            baseCommentView expected = null;                  // TODO: Initialize to an appropriate value
            baseCommentView actual;

            actual = target.GetComment(id);
            Assert.AreEqual(expected.Description, actual.Description);
            Assert.AreEqual(expected.ID, actual.ID);
            Assert.AreEqual(expected.RequirementID, actual.RequirementID);
        }
Exemple #7
0
        public baseCommentView GetComment(int id)
        {
            Data.Services.CommentService        svc      = new Data.Services.CommentService();
            Data.Services.DataContracts.Comment contract = svc.GetCommentById(id);
            baseCommentView view = new baseCommentView
            {
                Description   = contract.Description,
                ID            = contract.ID,
                RequirementID = contract.RequirementID
            };

            return(view);
        }
Exemple #8
0
        public baseCommentView GetComment(int id)
        {
#if visual
            view = new baseCommentView()
            {
                Description   = @"Stub Comment",
                ID            = 1,
                RequirementID = 1
            };
            return(view);
#else
            QAManagement.Data.Services.CommentService svc = new Data.Services.CommentService();
            view = ConvertToView(svc.GetCommentById(ID));
            return(view);
#endif
        }
Exemple #9
0
        public void ConvertToViewTest()
        {
            CommentProvider target   = new CommentProvider(); // TODO: Initialize to an appropriate value
            baseCommentView expected = new baseCommentView()
            {
                Description = "Description", ID = 1, RequirementID = 1
            };                                                                                                           // TODO: Initialize to an appropriate value
            Comment item = new Comment()
            {
                Description = "Description", ID = 1, RequirementID = 1
            };
            baseCommentView actual;

            actual = target.ConvertToView(item);
            CompareViewObject(expected, actual);
        }
Exemple #10
0
 private static void CompareViewObject(baseCommentView expected, baseCommentView actual)
 {
     Assert.AreEqual(expected.Description, actual.Description);
     Assert.AreEqual(expected.ID, actual.ID);
     Assert.AreEqual(expected.RequirementID, actual.RequirementID);
 }