SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
I am currently writing a unit test for my processor using instructions from Chapter 6 of the SmartConnector Developers Guide. My processor currently works in an actual SmartConnector runtime; however, I receive errors when I perform any test. My tests are CancelTest, ExecuteTest, FixtureOneTimeSetup_Base, and ValidateTest. My code looks near exactly to the code in Chapter 6 of the SmartConnector Developers Guide and contains no syntax errors.
When I try to test my processor (using NUnit3 in Visual Studio 2019), I receive the following messages for all tests:
OneTimeSetUp: System.TypeLoadException : Method 'AddRange' in type 'Mongoose.Service.Data.MongooseDbContext' from assembly 'Mongoose.Service, Version=2.4.23.0, Culture=neutral, PublicKeyToken=223885051a9a1eff' does not have an implementation.
When I look closely into Mongoose.Service, I don't see the method "AddRange". I can tell that my processor is trying to execute the "Execute_Subclass" method in the processor, but I am unable to create a new EwsServerDataAdapter. Even when I have the following --- EwsServer = EwsServerDataAdapter.ConnectExisting(Name, Username, Password) --- it still doesn't seem to be able to create the EwsServerDataAdapter.
Is there something I am missing or calling incorrectly?
using Mongoose.Process;
using Mongoose.Test;
using Mongoose.Test.Processors;
using NUnit.Framework;
using SmartConnectorRuntime = Mongoose.Service.Mongoose;
namespace SetupProcessorFixture
{
[TestFixture]
public class SetupProcessorFixture : SmartConnectorTestFixtureBase, IProcessorTestFixture<eDriveSCProcessor.eDriveSCProcessor>
{
protected override void FixtrueOneTimeTearDown_Base()
{
SmartConnectorRuntime.InitIoC();
}
public eDriveSCProcessor.eDriveSCProcessor CreateTestableProcessor()
{
var processor = this.CreateProccessorInstanceWithDefaultValues();
return processor;
}
[Test]
public void CancelTest()
{
this.RunCancelTest();
}
[Test]
public void ExecuteTest()
{
this.RunExecuteTest();
}
[Test]
public void ValidateTest()
{
eDriveSCProcessor.eDriveSCProcessor processor = CreateTestableProcessor();
// verify that processor has no issues
var issues = this.ValidateProcessor(processor);
Assert.AreEqual(0, issues.Count);
// Mess with the processor to verify the things we want validated...
}
[Test]
protected override void FixtureOneTimeSetup_Base()
{
SmartConnectorRuntime.InitIoC();
}
}
}
Link copied. Please paste this link to share this article on your social media post.
Hi @Lydia,
This is most likely caused by the Smart Connector version you have installed on your PC, being older than your NuGet packages. The 'AddRange' methods were adding in versions 2.4.36 and newer.
If you upgrade your Smart Connector framework version install on your PC to the latest (2.4.38 for example), I believe this issue will be resolved.
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi @Lydia,
This is most likely caused by the Smart Connector version you have installed on your PC, being older than your NuGet packages. The 'AddRange' methods were adding in versions 2.4.36 and newer.
If you upgrade your Smart Connector framework version install on your PC to the latest (2.4.38 for example), I believe this issue will be resolved.
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
The SmartConnector upgrade fixed the problem beautifully. Thank you.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.