48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
using NUnit.Framework;
|
|
using Sarand.Net.Standard.Base.App;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Sacs.UnitTests.Net.Standard.Base.App
|
|
{
|
|
[TestFixture]
|
|
public class SacsProcessDefinition_Tester
|
|
{
|
|
// --- Tests ---
|
|
|
|
[Test]
|
|
public void SacsProcessDefinition_CTR()
|
|
{
|
|
// Valid process definitions.
|
|
Assert.That(new SacsProcessDefinition("SaProcess:ExportData"), Is.Not.Null);
|
|
Assert.That(new SacsProcessDefinition("SaProcess:Proc=ExportData"), Is.Not.Null);
|
|
Assert.That(new SacsProcessDefinition("SaProcess:ExportData;User=System"), Is.Not.Null);
|
|
|
|
// Invalid process definition - blank argument.
|
|
try
|
|
{
|
|
SacsProcessDefinition processDfn = new SacsProcessDefinition("");
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
Assert.That(exc.GetType(), Is.EqualTo(typeof(NotSupportedException)));
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public void SacsProcessDefinition_IsValidProcessDefinition()
|
|
{
|
|
// Valid process params.
|
|
Assert.That(SacsProcessDefinition.IsValidProcessDefinition("SaProcess:ExportData"), Is.EqualTo(true));
|
|
|
|
// Invalid process params.
|
|
Assert.That(SacsProcessDefinition.IsValidProcessDefinition(""), Is.EqualTo(false));
|
|
Assert.That(SacsProcessDefinition.IsValidProcessDefinition("Abc"), Is.EqualTo(false));
|
|
Assert.That(SacsProcessDefinition.IsValidProcessDefinition("SaProcess"), Is.EqualTo(false));
|
|
}
|
|
|
|
// --- The End ---
|
|
}
|
|
}
|