Hi,
I am trying to run nunit tests with Fake Info/InfoProvider objects and receiving an exception when running the test.
I am following this doc: https://docs.kentico.com/k11/custom-development/writing-automated-tests/faking-info-and-provider-objects-in-unit-tests
My simple test is:
using NUnit.Framework;
using CMS.Tests;
[TestFixture]
public class MyUnitTests : UnitTests
{
[SetUp]
public void MyUnitTestSetUp()
{
// Sets up faked metadata for UserInfo
//Fake<UserInfo>();
}
[Test]
public void Test()
{
Assert.AreEqual(true, true);
}
}
Running this test i get the error:
Message: System.MissingMethodException : Method not found: 'NUnit.Framework.Interfaces.IPropertyBag TestAdapter.get_Properties()'.
Method not found: TestAdapter.get_Properties()
Test Name: Test
Test FullName: Class1.Test
Test Source: c:\Class1.cs : line 15
Test Outcome: Failed
Test Duration: 0:00:00.053
Result StackTrace:
at CMS.Tests.TestsCategoryCheck.CheckCategories(Type testType)
at CMS.Tests.AutomatedTests.InitBase() in D:\CMS\PRODUCTION\11.0\CMSSolution\Tests\CMSTests\Base\AutomatedTests.cs:line 239
Result Message: System.MissingMethodException : Method not found: 'NUnit.Framework.Interfaces.IPropertyBag TestAdapter.get_Properties()'.
We are running Kentico 11.0.21 with the corresponding Kentico test libraries in visual studio 2017:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.9.9" targetFramework="net461" />
<package id="AWSSDK.Core" version="3.1.10.0" targetFramework="net461" />
<package id="AWSSDK.S3" version="3.1.9.0" targetFramework="net461" />
<package id="Castle.Core" version="4.0.0" targetFramework="net461" />
<package id="Castle.Windsor" version="4.0.0" targetFramework="net461" />
<package id="DocumentFormat.OpenXml" version="2.7.2" targetFramework="net461" />
<package id="Facebook" version="6.4.2" targetFramework="net461" />
<package id="GlobalLink.Connect" version="4.18.3.1" targetFramework="net461" />
<package id="Kentico.Libraries" version="11.0.21" targetFramework="net461" />
<package id="Kentico.Libraries.Tests" version="11.0.21" targetFramework="net461" />
<package id="linqtotwitter" version="4.0.0" targetFramework="net461" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net461" />
<package id="Microsoft.Azure.Search" version="3.0.2" targetFramework="net461" />
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net461" />
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net461" />
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net461" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.4" targetFramework="net461" />
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.4" targetFramework="net461" />
<package id="Microsoft.SharePointOnline.CSOM" version="16.1.6621.1200" targetFramework="net461" />
<package id="Microsoft.Spatial" version="6.15.0" targetFramework="net461" />
<package id="Microsoft.Web.Xdt" version="2.1.1" targetFramework="net461" />
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net461" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net461" />
<package id="NuGet.Core" version="2.14.0" targetFramework="net461" />
<package id="NUnit" version="3.10.0" targetFramework="net461" />
<package id="NUnit.Console" version="3.8.0" targetFramework="net461" />
<package id="NUnit.ConsoleRunner" version="3.8.0" targetFramework="net461" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.5.0" targetFramework="net461" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.7.0" targetFramework="net461" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net461" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.3" targetFramework="net461" />
<package id="NUnit.Extension.VSProjectLoader" version="3.7.0" targetFramework="net461" />
<package id="NUnit3TestAdapter" version="3.10.0" targetFramework="net461" />
<package id="OpenPop.NET" version="2.0.4.369" targetFramework="net461" />
<package id="PayPal" version="1.8.0" targetFramework="net461" />
<package id="Rx-Core" version="2.2.5" targetFramework="net461" />
<package id="Rx-Interfaces" version="2.2.5" targetFramework="net461" />
<package id="Rx-Linq" version="2.2.5" targetFramework="net461" />
<package id="Rx-Main" version="2.2.5" targetFramework="net461" />
<package id="Rx-PlatformServices" version="2.2.5" targetFramework="net461" />
<package id="System.Data.HashFunction.Core" version="1.8.2.2" targetFramework="net461" />
<package id="System.Data.HashFunction.CRC" version="1.8.2.2" targetFramework="net461" />
<package id="System.Data.HashFunction.Interfaces" version="1.0.0.2" targetFramework="net461" />
<package id="System.IO.FileSystem.Primitives" version="4.0.1" targetFramework="net461" />
<package id="System.IO.Packaging" version="4.0.0" targetFramework="net461" />
<package id="System.Spatial" version="5.6.4" targetFramework="net461" />
<package id="WindowsAzure.Storage" version="7.2.0" targetFramework="net461" />
</packages>
Any idea what is causing this exception?
Cheers, Stephen