Abstract base class for MSSQL server database testing.

Namespace:  TestFu.Data.SqlClient
Assembly:  TestFu (in TestFu.dll) Version: 2.4.2.1515 (2.4.2.1515)

Syntax

C#
public abstract class SqlFixture : DbFixture
Visual Basic (Declaration)
Public MustInherit Class SqlFixture _
	Inherits DbFixture

Examples

The DbFixture (SqlFixture for MsSQL server) can be used as a base class for the fixtures involving database testing.

CopyC#
[TestFixture]
public class DatabaseTest : SqlFixture
{
    public DatabaseTest()
    :base("Data Source=testserver;...","MyTestDatabase")
    {}

    [SetUp]
    public void SetUp()
    {
        this.Open();
        this.BeginTransaction();
    }

    [Test]
    public void Selec()
    {
        IDbCollection cmd = this.Connection.CreateCommand("select * from anytable",this.Transaction);
        ...
    }

    [TearDown]
    public void TearDown()
    {
        this.Close();
    }
}

Inheritance Hierarchy

System..::.Object
  TestFu.Data..::.DbFixture
    TestFu.Data.SqlClient..::.SqlFixture

See Also