乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 11|回复: 0

Microsoft Fakes平台不创建应用程序类。

[复制链接]

1

主题

1

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2016-1-2 17:41:19 | 显示全部楼层 |阅读模式
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);。
}。
}。
}。
有人知道如何修理它吗?。

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-2-4 21:59 , Processed in 0.204409 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表