Extension of Range and Random

Bug #629496 reported by Rechenelf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework
Triaged
Wishlist
Unassigned

Bug Description

[Issue now tracked at https://github.com/nunit/nunit-framework/issues/47]

Having parameterized tests is a very nice feature. Some additional possibilities for the attributes are needed:

Range with DateTime and Step as TimeSpan: Range (DateTime, DateTime, TimeSpan)
Range (long, long) without Step (implicitly 1) - or does this make conflicts with Range (int, int)?
unsigned variants
Range (Type sourceType, string sourceName, int start, int end) might also be nice. Than it is easy to use the same data for multiple tests, if sourceName implements IList. (like ValueSourceAttribute)
Range (string sourceName, int start, int end) see above

Random for long and float
unsigned variants

Revision history for this message
Rechenelf (matklaus) wrote :

Oh, one I have forgotten:
DateTime Random (DateTime, DateTime, TimeSpan, count)

Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 629496] [NEW] Extension of Range and Random

Nice ideas! Most will probably be moved to the 3.0 project.

Some implementation notes...

Range of DateTimes: Easy implementation, just like existing. All of these could
be generic in the future. In general, supporting a variety of types is a goal.

Range (Type, string, start, end) seems to stretch the notion of a range to mean
something else. It also requires the test code to be intimately
familiar with what
the source is about to return. So... not sure on this one.

I'd also like to add random strings matching certain specifications TBD.

If we move a way from a string name for sources, the signatures would
be changed accordingly.

@Rechenelf: Don't go overboard on tags! Launchpad has great search
capabilities, so finding "random" and "range" is quite easy. OTOH, tags
are great where some logical categorization or judgement is overlaid
on the bug list - e.g. feature, easy, gui. "Attribute" is a good one because
there would be too many false positives using a search.

Charlie

On Fri, Sep 3, 2010 at 6:19 AM, Rechenelf <email address hidden> wrote:
> Public bug reported:
>
> Having parameterized tests is a very nice feature. Some additional
> possibilities for the attributes are needed:
>
> Range with DateTime and Step as TimeSpan: Range (DateTime, DateTime, TimeSpan)
> Range (long, long) without Step (implicitly 1) - or does this make conflicts with Range (int, int)?
> unsigned variants
> Range (Type sourceType, string sourceName, int start, int end) might also be nice. Than it is easy to use the same data for multiple tests, if sourceName implements IList. (like ValueSourceAttribute)
> Range (string sourceName, int start, int end) see above
>
> Random for long and float
> unsigned variants
>
> ** Affects: nunitv2
>     Importance: Undecided
>         Status: New
>
>
> ** Tags: attribute feature random range
>
> --
> Extension of Range and Random
> https://bugs.launchpad.net/bugs/629496
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Postponed to 3.0

affects: nunitv2 → nunit-3.0
tags: added: framework
removed: random range
Changed in nunit-3.0:
status: New → Triaged
importance: Undecided → Wishlist
description: updated
tags: added: github
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.