正如标题所说 - 我无法找到包含带有Windows Store测试项目的文件的方式。 (A标准的.NET测试项目工作正常)MSTest - DeploymentItem属性在Windows Store测试项目上不可用
右键单击该解决方案,并执行:添加新的项目 - > C# - > Windows应用商店 - >单元测试库(Windows应用商店的应用程序)
你得到这个样板,我添加了DeploymentItem属性:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
namespace UnitTestLibrary1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
// this does not compile; DeploymentItem attribute not found
[DeploymentItem("wibble.txt")]
public void TestMethod1()
{
}
}
}
那么我错过了什么?在Windows Store单元测试中是否包含数据是不可能的,还是我需要不同的方法?
一个windows store测试项目在WinRT下运行,它的沙箱很大,所以你不能只添加对标准.NET DLL的引用。我确实尝试直接浏览到UnitTestFramework DLL来添加它,但它仍然不想识别该属性。 – MarcE 2013-03-19 12:09:27