Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Testing - test-containing assembly vs. add-in or workbook under test

未关闭
#8 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
csharp
领域
devtools, testing

调研方向

未指定任何仓库文件、入口点或现有测试;首先定位 Excel-DNA 测试实现及其与 xUnit runner 的集成。定义关联并加载加载项或工作簿所需的内容,然后根据所描述的 VBA、二进制 .xll、.xlam 和工作簿集成测试场景验证设计。

由索引模型根据 Issue 内容生成。

描述

Normally the test assembly would have a reference to the assembly-under-test, and when running tests it will load and exercise the code inside the assembly-under-test.

For the Excel-DNA testing we might not have that direct link. We should e.g. cover that case where the add-in-under-test is actually written in VBA, or we only have a binary .xll of the add-in under test. Then the test code will consist of C# code that tests the add-in functions and other features by driving (through the COM object model) an instance of Excel where the add-in gets loaded, and then exercised.

I'm not sure what the best way is to associate the test code with a particular add-in for testing. There might be two cases,

  • one where the add-in is part of the solution where the test code lives, and so can be referenced directly even if the code in the add-in is sometimes called directly while testing, and other times exercised through Excel.
  • one cases where the add-in-under-test is declared only by a path or an add-in name, and then it is loaded or activated in Excel but not referenced directly by the assembly with the tests in. In this case we need some way in the test code to declare what add-in or other workbook(s) is required to be loaded in Excel before the tests execute. There's a question here of where to find these files too, maybe in paths relative to . . . somewhere? . . .

So one scenario I'd like to cover with the Excel-DNA testing is to create integration tests for VBA code (in an .xlam add-in or just behind a workbook) as well as tests for workbooks without any code. The tests are written in C# / VB.NET and run with any xUnit runner. So beyond the loading and running environment, we might imagine some helpers classes that make it easier to set code or formulas inside a workbook, let it calculate and then check results.
That idea is somewhat similar to what the XlWings guy discusses here: https://www.xlwings.org/blog/unittests-for-microsoft-excel

主要语言
C#
星标
0
派生
2
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Excel-DNA/DeveloperTools 的其他 Issue

查看 Excel-DNA/DeveloperTools 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。