|
MbUnit |
Top Previous Next |
|
Purpose SeSMbUnit.vsi is a visual studio installer packaged with Rapise. It facilitates calling Rapise tests from MbUnit tests.
Usage
Installation
C:\Program Files\Inflectra\Rapise\Extensions\UnitTesting\MBUnit\SeSMbUnit
Syntax Use both the MbUnit.Framework and the SeSMbUnit namespaces:
using MbUnit.Framework;
MbUnit uses the class attribute [Test] to identify test methods. The corresponding attribute for SeSMbUnit is [SeSMbUnitTest(@"<path to .sstest>")]. Note that the SeSMbUnitTest attribute has a parameter, the file-path to the test that will be invoked.
The following example uses a test method simply as a wrapper for calling an .sstest:
[SeSMbUnitTest(@"T:\Samples\Cross Browser\CrossBrowser.sstest")] public void TestIEandFirefox() { int exitCode = SeSMbUnitHelper.TestExecute(); Assert.AreEqual(0, exitCode); }
Templates SeSMbUnit.vsi will install a template for Visual Studio called SeSMbUnitTests. The template includes the appropriate using statements and a blank test method. You can insert additional SeSMbUnitTest methods by right-clicking in the editor in Visual Studio, and selecting Insert Snippet > SeSMbUnitTest. The following code will be added:
[SeSMbUnitTest(/*Insert path to .sstest file which must be run.*/)] public void TestSeS() { int exitCode = SeSMbUnitHelper.TestExecute(); Assert.AreEqual(0, exitCode); }
You'll need to specify the file-path.
Samples There is a sample dll you can run in MbUnit. From the Rapise directory, you'll find it at: Extensions\UnitTesting\MBUnit\SeSMbUnit\SeSSamplesMbUnit\bin\Debug\SeSSamplesMbUnit.dll
See Also
|