public void Returns_InstanceOfTypeString_When_Executed() { //Arrange var editPostModel = new Mock <EditPostModel>(); editPostModel.Object.Id = 1; editPostModel.Object.Description = "New New New New New New NewNew New New New New v New"; //Act var result = postServices.EditPostDescription(editPostModel.Object); //Assert Assert.IsInstanceOfType(result, typeof(string)); }
public string Execute(IList <string> parameters) { var postId = this.validateCore.IntFromString(parameters[1], "postId"); var loggedUserId = this.userService.GetLoggedUserId(); var postToBeEdited = this.postService.FindPostById(postId); postToBeEdited.Description = parameters[2]; this.postService.VerifyPostOwnerId(postToBeEdited.UserId, loggedUserId); var result = postService.EditPostDescription(postToBeEdited); return(result); }