Tyrel,

Note that Random(int n) is already defined to generate n doubles between
0.0 and 1.0 (SampleType.Raw).

You'll have to add some code to GetData to recognize that the parameter
is an enum and change the SampleType to an appropriate IntRange. You
can't do it in the constructor, because the parameter is not available
at that point.

Charlie

-- 
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.
https://bugs.launchpad.net/bugs/1023084

Title:
  Add Enum support to RandomAttribute

Status in NUnit Test Framework:
  New
Status in NUnitLite Testing Framework:
  New

Bug description:
  Add support to the Random Attribute to select a random Enum Value from
  an enumeration

  [Test]
  public void Test([Random(numberOfRandomValues)] MyEnum value)
  {
      //Random generates a Random Value from MyEnum's Values
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunit-3.0/+bug/1023084/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~nunit-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~nunit-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to