samedi 21 janvier 2017

How should look tests for IService, IRepository

I wonder how should I test all this stuff

public interface IProductRepository : IRepository<Product>
{
    Product GetById(string id);
}

Concrete repository:

public class EFProductRepository : IProductRepository
{
    public Product GetById(string id){//Implementation}
}

Abstract service:

public interface IProductService
{
    Product GetById(string id);
}

Concrete service:

public class ProductService : IProductService
{
    private readonly IProductRepository _products;
    public Product GetById(string id) { //implementation }
}

The question is from what should I start my tests and how should it look like?

Aucun commentaire:

Enregistrer un commentaire