Bugs item #1942863, was opened at 2008-04-15 13:28
Message generated for change (Comment added) made by moudrick
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1942863&group_id=31650

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tasks
Group: 0.86
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alexey Moudrick (moudrick)
Assigned to: Nobody/Anonymous (nobody)
Summary: NUnit2 task ExpectedException with MatchType.Contains

Initial Comment:
I use [ExpectedException] with MatchType = MessageMatch.Contains for some my 
tests. 
It does not work in <nunit2 /> task.
But it works fine in nunit-console and other native NUnit test runners.

Code:
================================================
using System;
using NUnit.Framework;

namespace ExpectedExceptionBugDemo
{
    [TestFixture]
    public class DemoTests
    {
        [Test]
        [ExpectedException(typeof(Exception), ExpectedMessage = "123", 
MatchType = MessageMatch.Contains)]
        public void ExceptionExpectedTest()
        {
            throw new Exception("abc 123 abc");
        }
    }
}
================================================

nant.build content:
================================================
<?xml version="1.0"?>
<project default="default">
  <target name="default">
    <exec program="${framework::get-tool-path('msbuild.exe')}">
      <arg value="ExpectedExceptionBugDemo.csproj" />
      <arg value="/target:Rebuild" />
      <arg value="/property:Configuration=Debug" />
      <arg value="/verbosity:quiet" />
    </exec>
    <nunit2>
      <formatter type="Plain" />
      <test assemblyname="bin\Debug\expectedexceptionbugdemo.dll" />
    </nunit2>
  </target>
</project>
=================================================

nunit-console output:
=================================================
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.1.2600 Service Pack 2
  CLR Version: 2.0.50727.1433 ( Net 2.0.50727.1433 )

.
Tests run: 1, Failures: 0, Not run: 0, Time: 0.047 seconds
=================================================

NAnt output:
=================================================
Target framework: Microsoft .NET Framework 3.5
Target(s) specified: default

default:

     [exec] Microsoft (R) Build Engine Version 2.0.50727.1433
     [exec] [Microsoft .NET Framework, Version 2.0.50727.1433]
     [exec] Copyright (C) Microsoft Corporation 2005. All rights reserved.
     [exec]
   [nunit2] Tests run: 1, Failures: 1, Not run: 0, Time: 0.031 seconds
   [nunit2]
   [nunit2] Failures:
   [nunit2] 1) ExpectedExceptionBugDemo.DemoTests.ExceptionExpectedTest : 
Expected exception to have message: "123" but received message "abc 123 abc"
   [nunit2]    at ExpectedExceptionBugDemo.DemoTests.ExceptionExpectedTest() in 
d:\home\projects\ExpectedExceptionBugDemo1\DemoTests.cs:line 13
   [nunit2]
   [nunit2]
   [nunit2]

BUILD FAILED

D:\home\projects\ExpectedExceptionBugDemo1\nant.build(11,6):
Tests Failed.
================================================

See also attaches.

----------------------------------------------------------------------

>Comment By: Alexey Moudrick (moudrick)
Date: 2008-04-24 23:27

Message:
Logged In: YES 
user_id=955106
Originator: YES

Btw ReSharper itself has such issue :D

See here: http://www.jetbrains.net/jira/browse/RSRP-59907
and here: http://www.jetbrains.net/jira/browse/RSRP-43833

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1942863&group_id=31650

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to