Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hermanussen/f1c6ae921687ae2551131e6263d34ad2 to your computer and use it in GitHub Desktop.
Save hermanussen/f1c6ae921687ae2551131e6263d34ad2 to your computer and use it in GitHub Desktop.
[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")
{
{"Some field", "Some field value"}
}
}
})
{
// Assert data that was deserialized from the filesystem
Item home = db.Database.GetItem("/sitecore/content/home");
Assert.IsNotNull(home);
Assert.AreEqual("Hello!", home["Title"]);
// Assert data that was added using the regular approach
Item child = home.Children["Child"];
Assert.IsNotNull(child);
Assert.AreEqual("Some field value", child["Some field"]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment