In the App.config file of my test project:
<connectionstrings>
<add name="VisenoConnection" connectionstring="Test">
</add>
</connectionstrings>
My Setup method:
[SetUp]
public void StartTest()
{
Listcompanies = new List ();
for (int i = 0; i < 100; i++)
{
VisenoCompany company = new VisenoCompany();
company.Id = i;
company.Name = "webtop";
company.Address = "address";
companies.Add(company);
}
companies[1].CompanyKey = "123";
VisenoCompany.Setup(companies);
}
My test method:
[Test]
public void TestGetCompany()
{
CompanyRepository companyRepository = new CompanyRepository();
VisenoCompany company = companyRepository.Get(1);
Assert.That(company.Id == 1);
Assert.That(company.CompanyKey == "123");
Assert.That(company.Name == "webtop");
(...)
Subsonic now uses memory in stead of database. In this case the repositories and generated classes are even in a different project.
1 comment:
Hi. Greetings. This post is really good and blog is really interesting. It gives good details.
Software Testing Tutorial
Post a Comment