public void UpdateComment(baseCommentView view) { #if visual #else Data.Services.CommentService svc = new Data.Services.CommentService(); svc.UpdateComment(ConvertToModel(view)); #endif }
public baseCommentView ConvertToView(Comment item) { baseCommentView view = new baseCommentView(); view.ID = item.ID; view.Description = item.Description; view.RequirementID = item.RequirementID; return(view); }
public Comment ConvertToModel(baseCommentView item) { Comment model = new Comment(); model.ID = item.ID; model.Description = item.Description; model.RequirementID = item.RequirementID; return(model); }
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); }
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 }; }
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); }
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); }
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 }
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); }
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); }