Run a test or a test fixture under another user account.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public class ImpersonateAttribute : TestDecoratorPatternAttribute
Visual Basic (Declaration)
Public Class ImpersonateAttribute _
	Inherits TestDecoratorPatternAttribute

Examples

CopyC#
[TestFixture]
public class MyTestFixture
{
    [Test]
    [Impersonate(UserName = "Julius Caesar", Password = "VeniVidiVici")]
    [Impersonate(UserName = "Marcus Brutus", Password = "EtTuBrute?")]
    public void MyTest()
    {
        // Some test logic here...
    }
}

Inheritance Hierarchy

System..::.Object
  System..::.Attribute
    Gallio.Framework.Pattern..::.PatternAttribute
      Gallio.Framework.Pattern..::.DecoratorPatternAttribute
        Gallio.Framework.Pattern..::.TestDecoratorPatternAttribute
          MbUnit.Framework..::.ImpersonateAttribute

See Also