deploymentitem

Why does data driven unit test fail in vs2012 when it worked fine in vs2010?

こ雲淡風輕ζ 提交于 2019-11-29 10:59:49
I have some data driven unit tests that were working just fine in Visual Studio 2010. These tests were implemented using the following pattern. [TestMethod()] [DeploymentItem("path_to_data_dir_relative_to_solution\\my_data.xml")] [DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\my_data.xml", "Token", DataAccessMethod.Sequential)] public void MyTestMethod() { // Arrange const string EXPECTED_PARAM_NAME = "table"; string data = TestContext.DataRow["Data"].ToString(); var sut = new MyClassUnderTest(); // Act sut.DoSomething(data); // Assert Assert.IsTrue(sut

Problems with DeploymentItem attribute

六眼飞鱼酱① 提交于 2019-11-27 17:39:17
I'm currently maintaining an "old" system written in C#.net, removing some obsolete features and doing some refactoring. Thanks god, the previous guy wrote some unit tests (MSTests). I quite comfortable with JUnit tests, but didn't do yet much with MSTests. The test methods have a DeploymentItem attribute, specifying a text file which is parsed by the business logic method that is being tested and a 2nd DeploymentItem where just a path has been specified containing a bunch of TIF files that have to be deployed too. [TestMethod()] [DeploymentItem(@"files\valid\valid_entries.txt")]

Do MSTest deployment items only work when present in the project test settings file?

扶醉桌前 提交于 2019-11-27 02:41:53
I can't seem to grasp how MSTest deployment items are supposed to be configured. I have been able to get them working properly by modifying the project's test settings file, but this is less then ideal -- the deployment item configuration is separated from individual tests, and the file paths appear to be stored as absolute paths unless the files are under the solution folder. Am I not supposed to be able to add a deployment item using the [DeploymentItem] attribute on either a [TestClass] or [TestMethod] without having to create/modify a project test settings file? How do I accomplish this?

Problems with DeploymentItem attribute

你离开我真会死。 提交于 2019-11-26 22:35:20
问题 I'm currently maintaining an "old" system written in C#.net, removing some obsolete features and doing some refactoring. Thanks god, the previous guy wrote some unit tests (MSTests). I quite comfortable with JUnit tests, but didn't do yet much with MSTests. The test methods have a DeploymentItem attribute, specifying a text file which is parsed by the business logic method that is being tested and a 2nd DeploymentItem where just a path has been specified containing a bunch of TIF files that

Do MSTest deployment items only work when present in the project test settings file?

爷,独闯天下 提交于 2019-11-26 09:15:24
问题 I can\'t seem to grasp how MSTest deployment items are supposed to be configured. I have been able to get them working properly by modifying the project\'s test settings file, but this is less then ideal -- the deployment item configuration is separated from individual tests, and the file paths appear to be stored as absolute paths unless the files are under the solution folder. Am I not supposed to be able to add a deployment item using the [DeploymentItem] attribute on either a [TestClass]