Yats – Programming a Simple Test Case

By | March 26, 2013

This article will show how to write a simple test case for Yats. The test case will be written in C#. Other languages and test case loaders can be supported but these topics will be covered later.

It is recommended to create a new Visual Studio project for your test case suite for better test case management. The following project references should be added in order to support Yats Native test case interface:

  • Attributes
  • TestCase.Interface
  • TestCase.Parameter
  • TestRepositoryManager.YatsNative

A test case is discovered by YatsNative test repository manager by analyzing all assemblies (DLL files) in the directory. Any classes that implement IYatsTestCase are considered to be test cases.

The following test case code example does not have any parameters or result values and always passes:


using System;
using yats.TestCase.Interface;
using yats.TestRepositoryManager.YatsNative;

namespace yats.TestCase.DummyTestCase
{
public class AlwaysPass : IYatsTestCase
{
public AlwaysPass ()
{
}

public ITestResult Execute()
{
return new TestResult( ResultEnum.PASS );
}
}
}

Most importantly, the test case must implement IYatsTestCase (define Execute() method)

Leave a Reply

Your email address will not be published.