Exists() public method

Check for exist of content.
public Exists ( ContentModel content ) : bool
content ContentModel The content - requires host, path, and name property.
return bool
Exemplo n.º 1
0
        public void TestExists()
        {
            // Arrange
            var repo =
                new SqlContentRepository(new SqlDataRepository(), "DefaultDatabase", "CmsContent", string.Empty);

            // Act
            var result = repo.Exists(new ContentModel() { Host = "localhost", Path = "/ArticleTitle" });

            // Assert
            Assert.IsTrue(result);
        }
Exemplo n.º 2
0
        public void TestDelete()
        {
            // Arrange
            var repo =
                new SqlContentRepository(new SqlDataRepository(), "DefaultDatabase", "CmsContent", string.Empty);
            var model = new ContentModel() { Host = "localhost", Path = "/test/test/article" };

            // Act
            repo.Remove(model);
            var result = repo.Exists(model);

            // Assert
            Assert.IsFalse(result);
        }