Closed GoogleCodeExporter closed 9 years ago
Interesting idea.
I'm starting to think that we might want to reexamine how some of these
decorators
hook up to the tests.
* ExpectedExceptionAttribute works by setting some custom metadata that the test
executor knows about. The same metadata can be specified in other ways such as
in
CSV files for data-driven tests. This kind of metadata-driven test semantic is
unique to expected exceptions so we don't support it for impersonation or other
things.
* ImpersonateAttribute just wraps the test execution with an impersonation
context.
* BrowserAttribute (in the new MbUnit samples for WatiN) actually does support
multiple instances by making the test data driven. It injects a new test
parameter
and binds a data source that provides browser configuration options derived
from the
attribute properties. This way the test runs multiple times with different
configurations.
* TestCases produced by test factories have none of these capabilities. It is
not
possible to apply impersonation to a test case. It would be nice if we split up
decorators into two parts: the attribute and the logic. That way the logic
could
perhaps be reused elsewhere.
It seems to me like there ought to be a nice way to unify these mechanisms.
Any ideas?
Original comment by jeff.br...@gmail.com
on 9 Oct 2009 at 8:37
Original comment by Yann.Tre...@gmail.com
on 17 Jul 2010 at 8:08
Original comment by Yann.Tre...@gmail.com
on 27 Oct 2010 at 8:54
Done (v3.3 trunk)
It's now possible to write the following:
[TestFixture]
public class MyTestFixture
{
[Test]
[Impersonate(UserName = "Julius Caesar", Password = "VeniVidiVici")]
[Impersonate(UserName = "Marcus Brutus", Password = "EtTuBrute?")]
public void MyTest()
{
// Some test logic here...
}
}
Original comment by Yann.Tre...@gmail.com
on 27 Oct 2010 at 9:09
Original comment by Yann.Tre...@gmail.com
on 10 Feb 2011 at 11:28
Original issue reported on code.google.com by
niklas.d...@gmail.com
on 9 Oct 2009 at 6:42