Activity log for bug #1242315

Date Who What changed Old value New value Message
2013-10-20 11:21:39 Grzegorz Galezowski bug added bug
2013-10-27 04:01:33 Charlie Poole description The following code works fine with NUnit test adapter (VS 2012, nunit 2.6.2): [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class AnyAttribute : ParameterDataAttribute { public override IEnumerable GetData(ParameterInfo parameter) { if (parameter.ParameterType == typeof(int)) { return new[] { 122 }; } else { return new[] { "a" }; } } } public class Class1234 { [Test] public void ShouldBEHAVIOR([Any] int a, [Any] string b) { Assert.Fail("FAILED!"); } } But the following does not (although it works just fine in gui standalone nunit runner) and VS Test Runner marks the test as not run: [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class AnyAttribute : ParameterDataAttribute { public override IEnumerable GetData(ParameterInfo parameter) { if (parameter.ParameterType == typeof(int)) { return new[] { 122 }; } else { return new[] { "a" + new Random().Next() }; //______ONLY CHANGE________! } } } public class Class1234 { [Test] public void ShouldBEHAVIOR([Any] int a, [Any] string b) { Assert.Fail("FAILED!"); } } Best regards, grzesiek [This bug is now tracked at https://github.com/nunit/nunit-vs-adapter/issues/15] The following code works fine with NUnit test adapter (VS 2012, nunit 2.6.2):     [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]     public class AnyAttribute : ParameterDataAttribute     {       public override IEnumerable GetData(ParameterInfo parameter)       {           if (parameter.ParameterType == typeof(int))           {             return new[] { 122 };           }           else           {             return new[] { "a" };           }       }     }     public class Class1234     {       [Test]       public void ShouldBEHAVIOR([Any] int a, [Any] string b)       {         Assert.Fail("FAILED!");       }     } But the following does not (although it works just fine in gui standalone nunit runner) and VS Test Runner marks the test as not run:     [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]     public class AnyAttribute : ParameterDataAttribute     {       public override IEnumerable GetData(ParameterInfo parameter)       {           if (parameter.ParameterType == typeof(int))           {             return new[] { 122 };           }           else           {             return new[] { "a" + new Random().Next() }; //______ONLY CHANGE________!           }       }     }     public class Class1234     {       [Test]       public void ShouldBEHAVIOR([Any] int a, [Any] string b)       {         Assert.Fail("FAILED!");       }     } Best regards, grzesiek
2013-10-27 04:01:40 Charlie Poole tags github
2013-10-27 04:02:15 Charlie Poole nunit-vs-adapter: status New Triaged
2013-10-27 04:02:18 Charlie Poole nunit-vs-adapter: importance Undecided High