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"));

}