For testing, you need intermediate classes between your DBML and business logic code. Take a look at the repository template for more information on this.
, , , , 10 . , , , , ( ). :
public interface IRepository
{
int CountProduct();
}
public class DBLinqToSQLRepository : IRepository
{
public int CountProduct()
{
}
}
public class FakeRepository : IRepository
{
private List<Product> products = new List<Product>();
public int CountProduct()
{
return products.Count;
}
}
FakeRepositor -.