public ContentResult GetContentChildren(int id, string lang = "en") { // This is a special case as the root is only in English if (id == 1) { lang = "en"; } var tree = _contentTreeService.GetContentFamily(id, lang); return(CamelCaseJson(tree)); }
public void GetContentTree_ValidPageId_ReturnsTree() { // Arrange const int pageId = 123; var root = new ContentTreeRootItem(); _stubContentTreeService.GetContentFamily(pageId).Returns(root); // Act var result = _propertyViewerController.GetContentTree(pageId); // Assert Assert.AreEqual(SerializeToJson(root), result.Content); }
public ContentResult GetContentTree(int pageId) { var tree = _contentTreeService.GetContentFamily(pageId); return(CamelCaseJson(tree)); }