public static WebMethodResponse AccessComments(int requestId, CommentsType action, string comments) { var accessReq = new AccessRequest(requestId); comments = comments.FromJSONStringToObj<string>(); return accessReq.AddComment(comments, action); }
public void ShouldAllowAccessTeamToComment() { using (var db = new SNAPDatabaseDataContext()) { var req = db.SNAP_Requests.Single(x => x.submittedBy == "UnitTester"); var accessReq = new AccessRequest(req.pkId); accessReq.AddComment("This is access team comment", CommentsType.Access_Notes_AccessTeam); accessReq.AddComment("This is access team for approver comment", CommentsType.Access_Notes_ApprovingManager); accessReq.AddComment("This is access team for requestor comment", CommentsType.Access_Notes_Requestor); accessReq.AddComment("This is access team for superuser comment", CommentsType.Access_Notes_SuperUser); } using (var db = new SNAPDatabaseDataContext()) { var req = db.SNAP_Requests.Single(x => x.submittedBy == "UnitTester"); Assert.IsTrue(req.SNAP_Request_Comments.Count == 4); } }