unit testing - NUnit Test Runner and Visual Studio NUnit Test runner get different results for a test -
in the geometry library writing have strange test passes when run using nunit test runner in visual studio, when runs on regular nunit runner fails. testing same dlls
here test:
[test()] public void line_sort() { line line1 = new line(pointgenerator.makepointwithinches(3, 2, 5), pointgenerator.makepointwithinches(5, 3, 7)); //intersects @ -1, 0, 1 line line2 = new line(pointgenerator.makepointwithinches(6, 0, 0), pointgenerator.makepointwithinches(-5, 3, -1)); //intersects @ 6, 0, 0 line line3 = new line(pointgenerator.makepointwithinches(1, 1, 5), pointgenerator.makepointwithinches(2, 2, 4)); //intersects @ 0, 0, 6 line line4 = new line(pointgenerator.makepointwithinches(4, 10, 1), pointgenerator.makepointwithinches(4, 5, 2)); //intersects @ 4, 0, 3 line line5 = new line(pointgenerator.makepointwithinches(4, 2, 2), pointgenerator.makepointwithinches(4, 2, 1)); //doesnt intersect list<line> lines = new list<line> { line2, line3, line5, line4, line1 }; lines.sort(); lines[0].should().be(line1); lines[1].should().be(line3); lines[2].should().be(line4); lines[3].should().be(line2); lines[4].should().be(line5); }
it seems sort function works differently in 2 cases. causing test fail in nunit runner list order not equal expected.
what cause this? , how can fix it? our build server behaves same nunit runner
Comments
Post a Comment