public void GetWatchersOfDocTest() { var request = new GetWatchersOfDocRequest() { DocId = "3F558898BEDE55D2F6F2C454AA6D2774" }; var ret = _dal.GetWatchersOfDoc(request); Assert.AreEqual(1, ret.Tables.Count); var userId = ret.Tables[0].Rows[0]["userId"].ToString(); Assert.AreEqual("*****@*****.**", userId); }
public Response GetWatchersOfDoc(GetWatchersOfDocRequest request) { List <string> usersList = new List <string>(); try { var dataSet = _dal.GetWatchersOfDoc(request); var table = dataSet.Tables[0]; for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) { usersList.Add(table.Rows[i]["UserId"].ToString()); } var ret = new GetWatchersOfDocResponseOk() { UsersIds = usersList.ToArray() }; return(ret); } catch (Exception ex) { return(new AppResponseError(ex.Message)); } }