* Update gitignore * Move csproj * Update project references * Update solutions * Update build scripts * Tests used to share editorconfig with projects in src * Fix broken tests. * Stop copying around .editorconfig merged root one with linting * csharp_style_expression_bodied -> suggestion * Move StyleCop rulesets to matching directories and update shared build properties * Remove legacy build files, update NuGet.cofig and solution files * Restore myget source * Clean up .gitignore * Update .gitignore * Move new test classes to tests after merge * Gitignore + nuget config * Move new test Co-authored-by: Ronald Barendse <ronald@barend.se>
32 lines
830 B
C#
32 lines
830 B
C#
using System.Linq;
|
|
using NUnit.Framework;
|
|
using Umbraco.Web;
|
|
|
|
namespace Umbraco.Tests.PublishedContent
|
|
{
|
|
[TestFixture]
|
|
public class RootNodeTests : PublishedContentTestBase
|
|
{
|
|
[Test]
|
|
public void PublishedContentHasNoRootNode()
|
|
{
|
|
var ctx = GetUmbracoContext("/test");
|
|
|
|
// there is no content node with ID -1
|
|
var content = ctx.Content.GetById(-1);
|
|
Assert.IsNull(content);
|
|
|
|
// content at root has null parent
|
|
content = ctx.Content.GetById(1046);
|
|
Assert.IsNotNull(content);
|
|
Assert.AreEqual(1, content.Level);
|
|
Assert.IsNull(content.Parent);
|
|
|
|
// non-existing content is null
|
|
content = ctx.Content.GetById(666);
|
|
Assert.IsNull(content);
|
|
}
|
|
|
|
}
|
|
}
|