Re: SuiteAttribute & generics

"Nassar, Anthony" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <[email protected]>
Thanks, Haiping, but that's exactly what I'm already doing! I didn't
want to have to instantiate these classes statically. I was looking more
for something like the sample below. Maybe I just need to make better
use of the CategoryAttribute, so that instantiated generic fixtures get
grouped together in the results, and I'll be happy with that. 

public class AllTests
  {
    [Suite]
    public static TestSuite Suite
    {
      get
      {
        TestSuite suite = new TestSuite("All Tests");
        suite.Add(new Array1DTestCase<Algorithm.Uint8>());
        suite.Add(new Array1DTestCase<Algorithm.Int8>());
        suite.Add(new Array1DTestCase<Algorithm.float>());
        return suite;
      }
    }
  }


-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Friday, November 30, 2007 9:33 AM
To: Nassar, Anthony
Subject: Re: [Nunit-users] SuiteAttribute & generics

I test my C++  template classed use the following way:

namespace AlgorithmUnitTest
{
      template<class T>
  [TestFixture]
      public ref class Array1DTestCase
      {
      public:

            [Test] void TestConstructorAndDestructor();
            [Test] void TestResize();
           }


      template ref class Array1DTestCase<bool>;
      template ref class Array1DTestCase<Algorithm::Uint8>;
      template ref class Array1DTestCase<Algorithm::Int8>;
      template ref class Array1DTestCase<Algorithm::Uint16>;
      template ref class Array1DTestCase<Algorithm::Int16>;
      template ref class Array1DTestCase<Algorithm::Uint32>;
      template ref class Array1DTestCase<Algorithm::Int32>;
      template ref class Array1DTestCase<float>;
      template ref class Array1DTestCase<double>; }

Hope this will help,

Haiping



 

             "Nassar, Anthony"

             <[email protected]

             >
To
             Sent by:
<[email protected]>
             nunit-users-bounc
cc
             [email protected]

             rge.net
Subject
                                       [Nunit-users] SuiteAttribute &

                                       generics

             11/30/2007 08:16

             AM

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.