ObjectSharp Blogs

You are currently viewing

Dave Lloyd's 2 Cents

A .NET Developer's Perspective


DeploymentItem Attribute on a VSTS TestMethod

Did you know there are two ways to Deploy files to be used when executing unit tests in VSTS.

 

You can added them to the .Testrunconfig:

 

 

Or using the DeploymentItem attribute on the TestMethod:

 

 

[TestMethod,DeploymentItem(@"Bin\fr-CA\Thermo.Automation.Foundation.Tests.resources.dll","fr-CA")]

public void Multilanguage()

{

    Message msg = Message.Retrieve(Messages.Multilanguage);

    msgServ.Post(msg);

    Assert.IsTrue(msgServ.ValidateMessageReceived("English message"));

 

    Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-CA");

 

    Message msgFr = Message.Retrieve(Messages.Multilanguage);

    msgServ.Post(msgFr);

    Assert.IsTrue(msgServ.ValidateMessageReceived("French message"));

}    

 

Leave a Comment

(required) 
(optional)
(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS