I'm using MSTest as my testing framework and I'm wanting to Mock the Basket object so I can test the add to basket functionality.
I have a AddToBasket function in one of my surface controllers that does a small amount of business logic then adds to the basket using Basket.AddItemVariant, I want to be able to sucesfully test this.
I noticed there's a Merchello.Tests package on NuGet but one of its dependencies is Umbraco.Core which doesn't exist (Should it be UmbracoCms.Core?). Either way, I managed to install this package and it's not clear what objects I should be using for mocking. Are there any docs for unit testing online?
I had a look through the solution on GitHub and noticed everything was inherting from DatabaseIntegrationTestBase or a similar base class.
Unit testing - testing Basket
Hi all,
I'm using MSTest as my testing framework and I'm wanting to Mock the Basket object so I can test the add to basket functionality.
I have a
AddToBasket
function in one of my surface controllers that does a small amount of business logic then adds to the basket usingBasket.AddItemVariant
, I want to be able to sucesfully test this.I noticed there's a
Merchello.Tests
package on NuGet but one of its dependencies isUmbraco.Core
which doesn't exist (Should it be UmbracoCms.Core?). Either way, I managed to install this package and it's not clear what objects I should be using for mocking. Are there any docs for unit testing online?I had a look through the solution on GitHub and noticed everything was inherting from
DatabaseIntegrationTestBase
or a similar base class.This looks like what I need but I can't for the life of me get MerchelloContext working properly.
Thanks!
is working on a reply...