Book a Demo

Author Topic: NUnit/UseCase Test Results  (Read 5067 times)

lmmartin

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
NUnit/UseCase Test Results
« on: July 03, 2008, 04:09:51 am »
How do I get the unit tests (alt + 3) EA generated  for N-Unit to show up as failed?
When I run test under Build and Run all of the tests show pass.  I know 2 fail and 1 doesn't run.

Leo

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: NUnit/UseCase Test Results
« Reply #1 on: July 03, 2008, 08:29:22 am »
It's possible that the NUnit parser isn't correctly parsing the output in this situation.  If you can send in a bug report or post the NUnit output here we can probably fix it.

lmmartin

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: NUnit/UseCase Test Results
« Reply #2 on: July 03, 2008, 11:02:04 pm »
Also when the tests are rerun the results are overwritten not appended to.  List mode records who ran the test the dialog and workspace do not

EA Output for N-Unit

Running build script - Phone2      
Microsoft (R) Visual Studio Version 8.0.50727.762.      
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.      
------ Build started: Project: Phone2, Configuration: Debug Any CPU ------      
Phone2 -> D:\desktop\nUnitTest\Test2\Phone2\Phone2\bin\Debug\Phone2.exe      
------ Build started: Project: Caller, Configuration: Debug Any CPU ------      
Caller -> D:\desktop\nUnitTest\Test2\Phone2\Caller\bin\Debug\Caller.exe      
========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ==========      
D:\desktop\nUnitTest\Test2\Phone2\Phone2 Build completed with exit code 0      
NUnit version 2.4.7      
Copyright (C) 2002-2007 Charlie Poole.      
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.      
Copyright (C) 2000-2002 Philip Craig.      
All Rights Reserved.      
      
Runtime Environment -       
   OS Version: Microsoft Windows NT 5.0.2195 Service Pack 4      
  CLR Version: 2.0.50727.832 ( Net 2.0.50727.832 )      
      
..      
F............      
F..F.      
Tests run: 17, Failures: 3, Not run: 0, Time: 0.484 seconds      
      
Test Case Failures:      
1) Phone2.PhoneTest.testForFail :       
at Phone2.PhoneTest.testForFail() in D:\desktop\nUnitTest\Test2\Phone2\Phone2\PhoneTest.cs:line 109      
      
2) Phone2.PhoneTest.testSetExtension :   Expected: 1212      
  But was:  7890      
      
at Phone2.PhoneTest.testSetExtension() in D:\desktop\nUnitTest\Test2\Phone2\Phone2\PhoneTest.cs:line 82      
      
3) Phone2.PhoneTest.testSetPhoneNumber :   Expected string length 12 but was 13. Strings differ at index 0.      
  Expected: "919-555-1234"      
  But was:  "-870-555-7890"      
  -----------^      
      
at Phone2.PhoneTest.testSetPhoneNumber() in D:\desktop\nUnitTest\Test2\Phone2\Phone2\PhoneTest.cs:line 88      
      
      
Test Cases Created: 0, Test Cases Updated: 17      
Test completed with exit code 3      

as you can see there should be 3 fails but they are marked as pass.

Thank You
Leo

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: NUnit/UseCase Test Results
« Reply #3 on: July 04, 2008, 08:46:57 am »
It looks like our next build should fix your problem.

Let us know if it doesn't.

lmmartin

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: NUnit/UseCase Test Results
« Reply #4 on: July 08, 2008, 03:27:27 am »
Seems to work well.

Thanks
Leo

Tom.Beran

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • nothing to say
    • View Profile
Re: NUnit/UseCase Test Results
« Reply #5 on: November 13, 2008, 01:21:34 am »
I'm using NUnit version 2.4.8 and EA 7.1.833.

EA doesn't import results from NUnit. I have setted "build script" for testing correctly (checked "Capture output" and "Output parser -> NUnit" ), it imported testacses correctly,
When i run tests, i see the output from NUnit in EA's "Output window":
Code: [Select]
NUnit version 2.4.8      
Copyright (C) 2002-2007 Charlie Poole.      
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.      
Copyright (C) 2000-2002 Philip Craig.      
All Rights Reserved.      
      
Runtime Environment -       
   OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3      
  CLR Version: 2.0.50727.3053 ( Net 2.0.50727.3053 )      
      
.N.      
N.N.      
.N.      
.N.      
.      
.N.N.N.      
.N.N.N.N.      
.N..N.      
.      
...N.N....      
.N.N.N.      
.N.N.      
.      
.      
.N.N.      
.N.      
.      
...      
.F.N.N.      
.N.N.N.      
.N..N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.      
N.N.N.N.N.N.N.N.N.N.N.N.N.N.      
.N.N.N.N.N.N.N.N.N.N      
..      
..      
Tests run: 34, Failures: 1, Not run: 69, Time: 7.484 seconds      
      
Test Case Failures:      
.... etc ...

But in "Testing" or "Testing details" is filled just "Run by" and "Date run"  but there is no "Status" and Results are empty.

 This fields are corectly filled just in the first test case item in the list "Testing detail", all other rows have this fields empty ...

Can anybody help me? Where could be problem?  :-X
« Last Edit: November 14, 2008, 12:02:30 am by Tom.Beran »

Tom.Beran

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • nothing to say
    • View Profile
Re: NUnit/UseCase Test Results
« Reply #6 on: November 14, 2008, 12:55:43 am »
There is probably problem with testing methods, which test class inherits from parent class. I have some common test cases, which are implemented in parent test clas - this methotds test object persistency in database (savin, editing, deleting) ... this inherited test methods are not imported by EA from NUnit output and probably this inherited methods make problems to parse testing Results back into EA  :-[