Unit Testing Framework
This page provides instruction on Unit Testing your C# / .NET SanteDB Plugins
Install SanteDB Server TestFramework
Install-Package SanteDB.Server.TestFrameworkSetting up the TestApplicationContext
using SanteDB.Core;
using SanteDB.Core.TestFramework;
using System;
using NUnit.Framework;
namespace MyTest {
[TestFixture]
public class MyTestClass
{
[Setup]
public void Initialize() {
// Init test context if needed
if(ApplicationServiceContext.Current == null)
{
// Forces .NET To load the FirebirdSQL API
var p = FirebirdSql.Data.FirebirdClient.FbCharset.Ascii;
TestApplicationContext.TestAssembly = typeof(TestOpenHIEPixPdq).Assembly;
TestApplicationContext.Initialize(TestContext.CurrentContext.TestDirectory);
}
}
}
}Unit Tests for Data Services
Execution Environment

Last updated
Was this helpful?