This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<szfolders> | |
<folder name="core" value="c:\somefolder\data\serialization\core\" /> | |
<folder name="master" value="c:\somefolder\data\serialization\master\" /> | |
<folder name="web" value="c:\somefolder\data\serialization\web\" /> | |
</szfolders> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestCase] | |
public void TestCombined() | |
{ | |
using (Db db = new Db() | |
{ | |
new DsDbTemplate( | |
"/sitecore/templates/Sample/Sample Item"), | |
new DsDbItem("/sitecore/content/home", true) | |
{ | |
new DbItem("Child") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PLATFORM MODE IS ON - please check the CompiledDomainModel settings if this was unintentional | |
// | |
// Please use the following url and change it to your needs: | |
// http://sitecoredemo/sitecore/shell/Applications/CompiledDomainModel/CodeGenerator.aspx?platformsets=<PIPE_SEPARATED_SET_NAMES> | |
// | |
// Use one or more of the following names to generate for the part of the platform you need (exclude the brackets): | |
// [Core] (should be used in a project that all other projects have a dependency with) | |
// [PlatformTemplatesSet] (domain objects) | |
// [SomeProjectTemplatesSet] (domain objects) | |
// [PlatformFixedPaths] (fixed paths) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.web.webPages.razor> | |
... | |
<pages pageBaseType="System.Web.Mvc.WebViewPage"> | |
<namespaces> | |
... | |
<add namespace="Sitecore.Mvc" /> | |
<add namespace="UnitTestingDemo.Website.Util"/> | |
</namespaces> | |
</pages> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
using System.Text.RegularExpressions; | |
using System.Web; | |
using Sitecore.Collections; | |
using Sitecore.Data.Items; | |
using Sitecore.Diagnostics; | |
using Sitecore.Mvc.Helpers; | |
using UnitTestingDemo.Website.Domain; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pipelines> | |
<mvc.getModel> | |
<processor | |
patch:before="*[@type='Sitecore.Mvc.Pipelines.Response.GetModel.CreateDefaultRenderingModel, Sitecore.Mvc']" | |
type="UnitTestingDemo.Website.Pipelines.CreateTypedRenderingModel, UnitTestingDemo.Website"/> | |
</mvc.getModel> | |
</pipelines> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Sitecore.Mvc.Pipelines.Response.GetModel; | |
using Sitecore.Mvc.Presentation; | |
using UnitTestingDemo.Website.Domain; | |
using UnitTestingDemo.Website.Models; | |
namespace UnitTestingDemo.Website.Pipelines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Mvc.Presentation; | |
using UnitTestingDemo.Website.Domain; | |
namespace UnitTestingDemo.Website.Models | |
{ | |
/// <summary> | |
/// Use this interface as a model for a Razor view if you want to use a CDM wrapper from the view. | |
/// </summary> | |
/// <typeparam name="T">The type of the wrapper that the model needs to support</typeparam> | |
public interface IRenderingModel<out T> : IRenderingModel where T : ItemWrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model UnitTestingDemo.Website.Models.IRenderingModel<UnitTestingDemo.Website.Domain.DomainModel.Page> | |
<h1>@Html.Sitecore().Field(() => Model.Item.Title)</h1> | |
@Html.Sitecore().Field(() => Model.Item.TextContent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
[Description("Tests the import of an image into the media library")] | |
public void TestImageImport() | |
{ | |
string sampleImage = ConfigurationManager.AppSettings["sampleimage"]; | |
SampleSitecoreLogic.ImportImage(sampleImage); | |
// Get the imported media item | |
MediaItem imported = new MediaItem(Sitecore.Context.Database.GetItem("/sitecore/media library/Cdm")); |