| the code below will compile, but running nunit gui on the exe blows with
| an "unverifyable ..." or some other cryptic message. the nunit gui
| complains about this also. i've gone through 2.2.[56] 1.1/2.0 verisons.
| some versions of nunit were able to run their own tests. i had .net 2.0
| installled at home, but removed it. this is a nightmare
Ah! there's the rub!
In VS 2005 you would need to use /clr
ure which creates Pure & Verifiable
MSIL code.
http://msdn2.microsoft.com/85344whh(en-US,VS.80).aspx
Right now I don't see a VS 2003 equivalent:
http://msdn.microsoft.com/msdnmag/issues/04/05/VisualC2005/
Suggests that "Visual Studio .NET 2003 rarely produced verifiable code, and
even when it did, the effort it took in nontrivial cases was often
significant"...
| int _tmain() { Console::WriteLine(S"Hello World"); return 0; }
I suspect this is causing unverifiable code.
The following sample seems to work:
using namespace System;
using namespace NUnit::Framework;
namespace CUnitTest
{
[TestFixture] public __gc class Class1
{
public:
[SetUp] void Init() {}
[Test] void Add()
{
Assert::IsTrue(false);
}
};
}
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
| In article <
[email protected]>,
| (e-mail address removed) says...
| > Have you tried using "Project - References" to add a reference to the
| > nunit.framework assembly.
|
| that part usually works.
|
| > using namespace NUnit::Framework;
| >
| > namespace UnitTests
| > {
| > [TestFixture]
| ...
| >
| > NOTE: The above is C++/CLI syntax, earlier versions use the MC++ syntax.
| >
|
| if i add the cpp sample nunit stuff, it will compile. but the nunit gui
| complains.
|
| neither vs 2003 at home nor in the labs will opem the sample projects
| that come with the nunit sample.
|
| the code below will compile, but running nunit gui on the exe blows with
| an "unverifyable ..." or some other cryptic message. the nunit gui
| complains about this also. i've gone through 2.2.[56] 1.1/2.0 verisons.
| some versions of nunit were able to run their own tests. i had .net 2.0
| installled at home, but removed it. this is a nightmare
|
| it's probeblay some versioning issue, but i am new to the visual
| studio/.net environement (mostly eclipse/java). i am stuck with vs 2003
| and .net 1.1 in the labs at school.
|
| any pointers will be appreciated.
|
| #include "stdafx.h"
| #using <mscorlib.dll>
| using namespace System;
| using namespace NUnit::Framework;
| namespace NUnitSamples {
| [TestFixture]
| public __gc class SimpleCPPSample {
| public:
| [SetUp] void Init() {}
| [Test] void Add() {}
| };
| }
| int _tmain() { Console::WriteLine(S"Hello World"); return 0; }