Microsoft Fakes平台不创建应用程序类。
MS Visual Studio 2015企业版,我需要通过Microsoft Fakes平台为AcDbMgd.dll AcMng.dll的一些密封类生成垫片,我写了这些fakes-files: 。。
。
。
。
。
。
。
。
“Autodesk,AutoCAD . application services . application "/> 。
。
“Autodesk,AutoCAD . application services . document collection "/> 。
。
“Autodesk,AutoCAD . application services . document "/> 。
。
“Autodesk,AutoCAD . editor input . editor "/> 。
。
。
。
。
。
。
。
。
。
。
“Autodesk,AutoCAD . database services . database "/> 。
。
“Autodesk,AutoCAD . database services . transaction "/> 。
。
每个类都是密封的,*Microsoft Fakes Platform*不会为“Autodesk . AutoCAD . application services . application”创建shim(结果中不存在“ShimApplication”类):对于Document和DocumentCollection类型,我没有这个问题。我通过我的“HelloWorld”代码中的TODO注释标记了这个问题: using System;。
使用系统,诊断;。
使用微软,visual studio . test tools . unit testing;。
使用微软,QualityTools . Testing.Fakes。
。
使用shim_cad = Autodesk,AutoCAD . application services 。
. fakes . shim application;// TODO: ShimApplication不存在,。
使用Autodesk,AutoCAD . application services . fakes;。
使用Autodesk,AutoCAD . database services . fakes;。
使用Autodesk,AutoCAD . EditorInput.Fakes。
。
使用cad = Autodesk,AutoCAD . application services . application;。
使用Autodesk,应用服务;。
使用Autodesk,AutoCAD . DatabaseServices。
使用Autodesk,AutoCAD . EditorInput。
。
命名空间msfakes {。
[测试类]。
公共类UnitTest1 {。
。
/// 。
///尝试使用Microsoft Fakes for AutoCAD 。
/// 。
[测试方法]。
public void test method 1(){ 。
使用(ShimsContext,Create()) {。
。
ShimDocument doc = null。
。
ShimDocumentCollection docs = 。
new ShimDocumentCollection(){ 。
MdiActiveDocumentGet =()= > doc 。
};。
。
shim_cad,DocumentManagerGet =()= > docs;。
。
断言,IsNull(。
caddocument manager . MdiActiveDocument);。
}。
}。
}。
有人知道如何修理它吗?。
**** Hidden Message *****
页:
[1]