Questions tagged [nsubstitute]
Any question related to NSubstitute in Sitecore context can make use of this tag.
5
questions
1
vote
1
answer
127
views
Sitecore Unit Testing Trouble w/ NSubstitute and Nunit
I am newer to Sitecore and extremely new to its unit testing. been following examples online that mimic exactly what I am trying to accomplish but I seem to be getting an object reference(you will see ...
2
votes
1
answer
260
views
How to mock MediaManager in Sitecore using nSubstitute and xUnit
I am in the process of setting up some unit tests for a Sitecore project (using this guide as a starting point: https://www.codeflood.net/blog/2020/05/17/logicless-view-itemless-model/)
I have come ...
3
votes
1
answer
452
views
How to mock an ImageField in Sitecore using nSubstitute and xUnit
I am in the process of setting up some unit tests for a Sitecore project (using this guide as a starting point: https://www.codeflood.net/blog/2020/05/17/logicless-view-itemless-model/)
I have come ...
3
votes
1
answer
205
views
Unit testing a Sitecore component controller throws exception in mocked service
I'm using xUnit, NSubstitute, FluentAssertions and Sitecore FakeDb. Here is the controller that needs a test,
public class TransactionsController : Controller
{
private readonly ...
3
votes
1
answer
465
views
Unit Testing with GlassMapper and GetItemByIdOptions
I have some code that retrieves a glass item like this:
var root = this.RequestContext.SitecoreService.GetItem<ILookupFolderTemplate>(
new GetItemByIdOptions(new Guid("{...