Kevin,

Attached is a zip of a project with NUnit working.

The testname attribute must be the full namespace and include the class
name.  If it is just the namespace or ends in a method, then the error
you see is returned.

It looks like the testname attribute must actually refer to the
[TestFixture] and not a specific [Test].

Noel



-----Original Message-----
From: Burton, Kevin [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 26, 2004 4:41 PM
To: Gifford, Noel
Subject: RE: [Nant-users] Nunits task?

This resulted in the same error as before. "Object reference no set to
an instance of an object."

Kevin

-----Original Message-----
From: Gifford, Noel [mailto:[EMAIL PROTECTED]
Sent: Monday, July 26, 2004 6:32 PM
To: Burton, Kevin
Subject: RE: [Nant-users] Nunits task?


Try using the full namespace for the testname attribute:

testname="visa.dps.ppc.data.DataTests.TestMailAddressSourceLookupRequest
"

Noel

-----Original Message-----
From: Burton, Kevin [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 26, 2004 4:07 PM
To: Gifford, Noel
Subject: RE: [Nant-users] Nunits task?

Thank  you for your persistence.

I tried changing the '/' to '\' but no effect.

I tried to remove the testname and I don't get an error. There must be
something wrong with the testname. I think it works without testname but
I cannot be sure. I cannot let all of the tests run as it would take too
long. I had to interrupt the test as I knew that it would take some
time. But I think I/we are making progress.

DataTests.dll is the assembly. Inside the assembly there is a namespace
visa.dps.ppc.data and a class called DataTests that all of the tests
reside as methods in.

Kevin


-----Original Message-----
From: Gifford, Noel [mailto:[EMAIL PROTECTED]
Sent: Monday, July 26, 2004 5:40 PM
To: Burton, Kevin
Subject: RE: [Nant-users] Nunits task?


Have you tried removing the testname attribute and letting it run all
tests in the assembly?

I don't know if it matters, but you might try changing the '/' to '\' in
the paths.

Is DataTests the namespace?

Let me know how it goes.  I'll try to help further.

Noel

-----Original Message-----
From: Burton, Kevin [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 26, 2004 3:29 PM
To: Gifford, Noel
Subject: RE: [Nant-users] Nunits task?

It would be good if I really don't need a configuration file. I am still
getting:

            D:\Projects\Visa\MR0804\Application Server Code\NUnit
Tests\DataTests\default.build(29,10):
            NUnit error.
                Object reference not set to an instance of an object.

I changed the task slightly:

        <nunit2>
            <formatter type="Plain" usefile="true"
outputdir="${build.dir}/results" />
            <test assemblyname="${build.dir}/DataTests.dll"
testname="DataTests.TestMailAddressSourceLookupRequest" fork="false" />
        </nunit2>

DataTests.dll is present. I can run NUnit tests from the NUnit GUI using
this assembly.

Kevin Burton
[EMAIL PROTECTED]

-----Original Message-----
From: Gifford, Noel [mailto:[EMAIL PROTECTED]
Sent: Monday, July 26, 2004 3:59 PM
To: Burton, Kevin; [EMAIL PROTECTED]
Subject: RE: [Nant-users] Nunits task?


I don't think you need the config file.  I don't use one.
You do need to ensure that your DLLs are built using the same version of
NUnit that is eventually used to run the unit tests.

Noel

I do the following:

    <target name="UnitTest" depends="Build" >
                <foreach item="File" property="filename">
                        <in>
                        <items>
                            <include
name="${RootDir.Solution}\**\bin\**\*.UnitTests.dll" />
                        </items>
                    </in>
                    <do>
                        <echo message="Executing unit tests in
'${filename}'" />
                        <nunit2>
                                <formatter type = "Xml" extension=".xml"
usefile="true" outputdir="${RootDir.Builds}\Tests" />
                            <test assemblyname="${filename}"
fork="false" />
                        </nunit2>
                    </do>
                </foreach>

    </target>




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Burton,
Kevin
Sent: Monday, July 26, 2004 12:57 PM
To: [EMAIL PROTECTED]
Subject: [Nant-users] Nunits task?

The documentation indicates that I need to add some lines to the test
application config file. I didn't have an application config file so I
created one:

<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="nunit.framework"
publicKeyToken="96d09a1eb7f44a77" culture="Neutral" /> 
                <bindingRedirect oldVersion="2.0.6.0"
newVersion="2.1.4.0" /> 
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

The name of the DLL is TandemTests.DLL so the config file is
TandemTests.DLL.Config.

I am still getting the error:

            Build failed
            
            D:\Projects\Visa\MR0804\Application Server Code\NUnit
Tests\TandemTests\default.build(28,10):
            NUnit error.
                Object reference not set to an instance of an object.
            
            Total time: 1.5 seconds.

Is the configuration file in the wrong place?

Here is the task:

        <nunit2>
            <formatter type="Plain" usefile="true"
outputdir="${build.dir}" />
            <test assemblyname="${build.dir}/TandemTests.dll"
testname="TandemInterfaceTests.TestHandshake" haltonfailure="true"
appconfig="TandemTests.dll.config" />
        </nunit2>

Any sugestions?

Thank you.

Kevin Burton
[EMAIL PROTECTED]


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id040&op=ick
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

===========================================================================
WARNING: In accordance with Intel's security policy this email
has been modified.

The file attachment NAntNUnitTest/DataTests/bin/Release/DataTests.dll is a restricted 
file type and has been removed from
 the following message: RE: [Nant-users] Nunits task?.  If you require this file, 
please contact the sender
 and arrange an alternate means of receiving it.


Reply via email to