I'm getting error C3095: 'Xunit::Extensions::InlineDataAttribute': attribute cannot be repeated
in C++/CLI code but not C#.
xUnit.net looks like the answer to my prayers - a modern unit test framework with GUI working with C++/CLI. However, using their approach to parameterised testing gives me the error C3095 as shown below.
Any ideas?
I'm using the latest xUnit.net 1.6 with Visual Studio 2008SP1.
using namespace Xunit;
using namespace Xunit::Extensions;
public ref class ParameterisedTestClass
{
public:
[Theory]
[InlineData("Kilroy", 6)]
// uncomment to cause c3095 [InlineData("Jones", 5)]
void PropTest(String^ msg, int msgLen)
{
Assert::Equal(msg->Length, msgLen);
}
};
the equivalent in C# is fine
using Xunit;
using Xunit.Extensions;
public class ParameterisedTestClass
{
[Theory]
[InlineData("Kilroy", 6)]
[InlineData("Jones", 5)]
public void PropTest(String msg, int msgLen)
{
Assert.Equal(msg.Length, msgLen);
}
};