public void PreviewComment_Get_Page() { var comments = PreviewCommentActions.GetPreviewComments("[{ \"id\": \"abc\", \"page\": 1 }, " + " { \"id\": \"def\", \"page\": 2 }" + "]", 2).ToArray(); Assert.AreEqual("def", comments.Single().Id); }
public void PreviewComment_Get_All() { var comments = PreviewCommentActions.GetPreviewComments("[{ \"id\": \"abc\", \"page\": 1 }, " + " { \"id\": \"def\", \"page\": 2 }" + "]", -1).ToArray(); Assert.AreEqual(2, comments.Length); Assert.AreEqual("abc", comments[0].Id); Assert.AreEqual("def", comments[1].Id); }
public void PreviewComment_Get_More() { var comments = PreviewCommentActions.GetPreviewComments("[{ \"id\": \"abc\", \"page\": 1 }, " + " { \"id\": \"def\", \"page\": 2 }," + " { \"id\": \"ghi\", \"page\": 2 }," + " { \"id\": \"jkl\", \"page\": 3 }," + "]", 2).ToArray(); Assert.AreEqual(2, comments.Length); Assert.AreEqual("def", comments[0].Id); Assert.AreEqual("ghi", comments[1].Id); }
public void PreviewComment_Get_One() { var comment = PreviewCommentActions.GetPreviewComments("[" + "{ \"id\": \"abc\", \"page\": 1, \"x\": 11, \"y\": 12, \"text\": \"cmmnt\", \"createdBy\": \"usr1\", \"creationDate\": \"2019.02.27. 15:38:00\" }, " + "{ \"id\": \"def\", \"page\": 2 }" + "]", 1).Single(); Assert.AreEqual("abc", comment.Id); Assert.AreEqual("cmmnt", comment.Text); Assert.AreEqual("usr1", comment.CreatedBy); Assert.AreEqual(1, comment.Page); Assert.AreEqual(11, comment.X); Assert.AreEqual(12, comment.Y); Assert.AreEqual(new DateTime(2019, 02, 27, 15, 38, 0), comment.CreationDate); }