Question

I'm using the VS2010 database unit testing framework. I've already created a condition inheriting from DataSetTestCondition and that worked fine. I'm now trying to write a condition inheriting from ResultSetCondition, but I keep getting the error:

'DBUnitTestConditions.ConditionMulti' does not implement inherited abstract member 'Microsoft.Data.Schema.UnitTesting.Conditions.ResultSetCondition.DoAssert(System.Data.DataTable)'

This is basically the code I'm using:

using Microsoft.Data.Schema.UnitTesting.Conditions;
using System.Data;

namespace DBUnitTestConditions
{
    public class ConditionMulti : ResultSetCondition  
    {
        public ConditionMulti()
        {

        }

        public void DoAssert(DataTable dt)
        {

        }
    }
}

If I try to use the object browser to have a look in ResultSetCondition there is nothing refering to DosAssert there. But if I use the Solution Navigator I see DoAssert, but it appears to be private. Any help would be appreciated.

thanks

Was it helpful?

Solution

EDIT: Complete rewrite

I've checked the source code:

namespace Microsoft.Data.Schema.UnitTesting.Conditions
{
     public abstract class ResultSetCondition : TestCondition
     {
          //...      
          internal abstract void DoAssert(DataTable resultSet);
     }
}

So the DoAssert marked as internal. So you cannot inherit from ResultSetCondition because internal abstract means that the class can only be inherited in the assembly that defined it.
There is no way around that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top