Questions tagged [unit-testing]

Only for questions that are specific to unit testing Sitecore-based features, controls, renderings and other Sitecore-specific application logic

Filter by
Sorted by
Tagged with
3
votes
4answers
2k views

Technique for changing Sitecore configuration for unit tests

When we unit test we often need to change some Sitecore configuration for the tests. For example, we may have the following: <sitecore> <configuration> <someNode name="myService"&...
8
votes
1answer
7k views

How to get started with Sitecore Unit Testing with SitecoreFakeDb

I'm trying to find the correct approach to begin unit testing the piece of code below: public class NameUtility { private readonly string _folder = Settings.GetSetting("FolderId"); public ...
1
vote
0answers
613 views

Unit testing contentsearch with facets

I am trying to write a test for this code: var publicationYears = new List<string>(); using (var context = searchContextBuilder.GetSearchContext(Indexes.NewsIndex)) { var query = context....