Adapter does not detect multiple tests when using arrays in testcase
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Test Adapter |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Test Explorer only shows one test, given the following method.
public void Class1Test(int expectedTotal, int[] vals)
{
var calc = new Calculator();
int total = calc.AddNums(vals);
}
Changing the first int in one of the test cases causes Explorer to show two test:
public void Class1Test(int expectedTotal, int[] vals)
{
var calc = new Calculator();
int total = calc.AddNums(vals);
}
Used "install-package NUnitTestAdapte
NUnit gui shows two test in both of the above scenarios.
description: | updated |
Changed in nunit-vs-adapter: | |
status: | New → Triaged |
importance: | Undecided → Medium |
milestone: | none → 2.0 |
importance: | Medium → Wishlist |
Changed in nunit-vs-adapter: | |
status: | Won't Fix → Triaged |
tags: | added: github |
This is a subtle variation on an already known problem. Test Explorer will 5,<int[ ]>)"
not allow tests with duplicate names, although NUnit does. Any true
resolution of the issue will involve a change to Test Explorer but we can
mitigate the problem by eliminating certain cases of duplication. In this
case, NUnit generates a name similar to "Class1Test(
You can work around the problem by applying your own name to the test via
the TestName property of the attribute.
Charlie
On Sat, Aug 3, 2013 at 12:05 AM, Carole Snyder <email address hidden>wrote:
> Public bug reported: AreEqual( expectedTotal, total); AreEqual( expectedTotal, total); r.WithFramework " to install version AreEqual( expectedTotal, total); AreEqual( expectedTotal, total); AreEqual( expectedTotal, total);
>
> Test Explorer only shows one test, given the following method.
>
> [TestCase(5, new int[] { 2, 3 })]
> [TestCase(5, new int[] { 1, 2, 2 })]
> public void Class1Test(int expectedTotal, int[] vals)
> {
> var calc = new Calculator();
> int total = calc.AddNums(vals);
> Assert.
> }
>
> Changing the first int in one of the test cases causes Explorer to show
> two test:
>
> [TestCase(5, new int[] { 2, 3 })]
> [TestCase(6, new int[] { 1, 2, 2 })]
> public void Class1Test(int expectedTotal, int[] vals)
> {
> var calc = new Calculator();
> int total = calc.AddNums(vals);
> Assert.
> }
>
> Used "install-package NUnitTestAdapte
> 0.96 on Visual Studio 2012 Update 3.
>
> NUnit gui shows two test in both of the above scenarios.
>
> ** Affects: nunit-vs-adapter
> Importance: Undecided
> Status: New
>
> ** Description changed:
>
> Test Explorer only shows one test, given the following method.
>
> - [TestCase(5, new int[] { 2, 3 })]
> - [TestCase(5, new int[] { 1, 2, 2 })]
> - public void Class1Test(int expectedTotal, int[] vals)
> - {
> - var calc = new Calculator();
> - int total = calc.AddNums(vals);
> - Assert.
> - }
> + [TestCase(5, new int[] { 2, 3 })]
> + [TestCase(5, new int[] { 1, 2, 2 })]
> + public void Class1Test(int expectedTotal, int[] vals)
> + {
> + var calc = new Calculator();
> + int total = calc.AddNums(vals);
> + Assert.
> + }
>
> + Changing the first int in one of the test cases causes Explorer to show
> + two test:
>
> - Changing the first int in one of the test cases causes Explorer to show
> two test:
> + [TestCase(5, new int[] { 2, 3 })]
> + [TestCase(6, new int[] { 1, 2, 2 })]
> + public void Class1Test(int expectedTotal, int[] vals)
> + {
> + var calc = new Calculator();
> + int total = calc.AddNums(vals);
> + Assert.
> + }
>
> - [TestCase(5, new int[] { 2, 3 })]
> - [TestCase(6, new int[] { 1, 2, 2 })]
> - public void Class1Test(int expectedTotal, int[] vals)
> - {
> - var calc = new Calculator();
> - int total = calc.AddN...