lundi 19 octobre 2015

VS 2012 does not recognize my test class

In Visual Studio 2012, it never runs the LoadTitle() method. If I remove the : AbstractDependencyInjectionSpringContextTests and override the method, at least it recognize the LoadTitle() as a test one. How do I make this class be recognized by MS 2012 test?

[TestFixture]
public class MyDaoTests : AbstractDependencyInjectionSpringContextTests  {
{
    // this instance will be (automatically) dependency injected    
    private HibernateTitleDao titleDao;

    // a setter method to enable DI of the 'titleDao' instance variable
    public HibernateTitleDao HibernateTitleDao {
        set { titleDao = value; }
    }

    [Test]
    public void LoadTitle() {
        Title title = this.titleDao.LoadTitle(10);
        Assert.IsNotNull(title);
    }

    // specifies the Spring configuration to load for this test fixture
    protected override string[] ConfigLocations {
        return new String[] { "assembly://MyAssembly/MyNamespace/daos.xml" };
    }
}

Aucun commentaire:

Enregistrer un commentaire