public Retrieve ( |
||
content | The content - requires host, path, and name property. | |
includeData | bool | if set to |
리턴 |
public void TestSaveNewContent() { // Arrange var repo = new SqlContentRepository(new SqlDataRepository(), "DefaultDatabase", "CmsContent", string.Empty); // Act var result = repo.Retrieve(new ContentModel() { Host = "localhost", Path = "/test/test/article-title" }); repo.Save( new ContentModel() { Host = "localhost", Path = "/test/test/article-title", Data = System.Text.Encoding.UTF8.GetBytes("test") }); var result2 = repo.Retrieve(new ContentModel() { Host = "localhost", Path = "/test/test/article-title" }); // Assert Assert.IsNotNull(result.Data); Assert.IsNotNull(result2.Data); Assert.AreNotEqual(System.Text.Encoding.UTF8.GetString(result.Data), System.Text.Encoding.UTF8.GetString(result2.Data)); }
public void TestRetrieveGetContent() { // Arrange var repo = new SqlContentRepository(new SqlDataRepository(), "DefaultDatabase", "CmsContent", string.Empty); // Act var result = repo.Retrieve(new ContentModel() { Host = "localhost", Path = "/ArticleTitle" }, true); // Assert Assert.IsNotNull(result.Data); Assert.IsTrue(result.DataLength > 0); }