In memory IContentRepository – The genealogy of pages

This post is part of a series of post where I try to implement an in memory IContentRepository. The tests for this posts are found here and here. This post will look at the last members of the IContentLoader interface for a while, namely GetDescendents and GetAncestors. First thing that pop out is that Descendents …

In memory IContentRepository – Getting children

This post is part of a series of post where I try to implement an in memory IContentRepository. The tests for this posts are found here. In this post we’ll continue to look at another member of the IContentLoader interface, namely the GetChildren method. There’s an interesting method with the signature But since we, like …

In memory IContentRepository – Getting a page

This post is part of a series of post where I try to implement an in memory IContentRepository. The tests for this posts are found here. When getting a page we’re using the IContentLoader interface. In this post we’ll focus in the most simple case, to load a page by a page reference and not …

Testing IContentRepository

If you want to test against IContentRepository you have some different options. 1. Database This is basically the same thing as when you’re running the site. In your test project you start up episerver in a console mode and each query/command is executed against the database in the same way it would have been if …

EPiServer 7 patch 2, MVC and session state

When my colleague Niklas Melinder applied patch 2 for EPiServer 7 he ran into trouble when the site was deployed to our acceptance server. The site started to throw “System.InvalidOperationException: The SessionStateTempDataProvider class requires session state to be enabled.”. Since our acceptance environment runs with sessions state switched off it was pretty clear what caused …

API when creating page data used for tests

Some context: when using an in memory implementation of IContentRepository (most likely in a test scenario) you need to create pages that are involved in the tests. I’m not quite sure which approach I fancy so I thought I’d ask you. Given that these two snippets produces the same result, do you find one “better” …

One reason why I don’t like service locator

Let’s say I want to use the new (brilliant) ISelectionFactory to easily create a list of something for the editor to choose. The data the editor uses is fetched from EPiServers IContentRepository. Unfortunately this won’t work since the class is not created from the container. Instead we get an error in edit mode saying the …

UI-testing (EPiServer): SpecFlow

This post is not going to be about what BDD / Specification by example is and the benefits of it but more of a quick start with doing UI-testing in a SpecFlow manner. Installing SpecFlow Although it’s not technically necessary I’d advice you to add the SpecFlow extension to Visual Studio. This is added through …