[nem-en] [NemerleUnit] What about other attributes available
in NUnit?
Kamil Dworakowski
kamil.dworakowski at googlemail.com
Fri Feb 2 22:52:10 CET 2007
Andrey Khropov wrote:
> To fully explore all the features present in NUnit we need to support other
> notions present in NUnit in form of attributes:
>
That was never my intention to support all the features of NUnit. My aim
was to make a DSL to write readable tests. I will object to any change
that would compromise that goal.
I think that with NemerleUnit in its current state I can implement 95%
unit tests I want. For the remaining 5% I would use NUnit directly. For
instance, Template Pattern for tests where you create an abstract
TestFixture class and concrete TestFixture subclasses (sometimes done to
test interfaces or abstract classes).
> 1) TestFixture
> AFAIKS the current implementation implicitly adds this attribute to the
> current enclosing type when test macro is executed. Maybe it's Ok or maybe
> there should be a testfixture macro (for consistency with test macro style):
>
>
> testfixture MyFixture // translated to [TestFixture] module MyFixture
> {
> ...
> }
>
That would allow for having two test fixtures in one file, but it's
probably hard to implement. Currently there is a fixture made
automatically for your testing pleasure.
> 2) TestFixtureSetup, TestFixtureTearDown.
>
They would not be easy to add and are rarely needed at the same time.
> 3) ExpectedException, Platform, Category, Explicit, Ignore
>
> These cases are more complicated. Can we add attributes like always:
>
> [ExpectedException(typeof(InvalidOperationException))]
> test MyTest
> {
>
> }
>
> ?
>
These should be easy to add. I would do sth like
expect_exception exception_type "decription for the test"
{
}
ignore_test "name"
{
}
Kamil Dworakowski
More information about the devel-en
mailing list