I am trying to set up unit tests for an Umbraco website for which I need the UmbracoContext. I included the Umbraco.Tests.dll using this package: https://github.com/kedde/Our.Umbraco.Community.Tests And I installed Nunit with NuGet.
When I create a Normal test-case everything works as expected. But as soon as I use "BaseRoutingTest" (to get the UmbracoContext). NUnit does not find my testcase, causing it to not run.
Below is my testcase code:
[TestFixture]
public class NewTests : BaseRoutingTest
{
[Test]
public void ShouldLoadContext()
{
var context = UmbracoContext.Current;
Assert.True(context != null);
}
}
The output for my tests is:
[21/10/2019 14:18:46 Informational] Executing test method 'MyWebsite.NewTests.ShouldLoadContext'
[21/10/2019 14:18:46 Informational] ------ Run test started ------
[21/10/2019 14:18:47 Informational] NUnit Adapter 3.15.1.0: Test execution started
[21/10/2019 14:18:47 Informational] Running all tests in C:...\MyWebsite\bin\Debug\MyWebsite.dll
[21/10/2019 14:18:47 Informational] NUnit failed to load C:...\MyWebsite\bin\Debug\MyWebsite.dll
[21/10/2019 14:18:47 Informational] NUnit Adapter 3.15.1.0: Test execution complete
[21/10/2019 14:18:47 Warning] No test matches the given testcase filter 'FullyQualifiedName=MyWebsite.NewTests.ShouldLoadContext' in C:...\MyWebsite\bin\Debug\MyWebsite.dll
[21/10/2019 14:18:47 Informational] ========== Run test finished: 0 run (0:00:01,0771566) ==========
Using Umbraco.Tests in NUnit test project.
Hi,
I am trying to set up unit tests for an Umbraco website for which I need the UmbracoContext. I included the Umbraco.Tests.dll using this package: https://github.com/kedde/Our.Umbraco.Community.Tests And I installed Nunit with NuGet.
When I create a Normal test-case everything works as expected. But as soon as I use "BaseRoutingTest" (to get the UmbracoContext). NUnit does not find my testcase, causing it to not run.
Below is my testcase code:
The output for my tests is:
Do you guys have any idea what I am doing wrong?
is working on a reply...