如何为Nunit项目下的所有methods/class创建一个文档

How to create a document for all methods/class under Nunit project

我目前正在使用 C# 和 VS 代码进行 Selenium Nunit 测试。

我们正在遵循页面对象模型。

我们只是想列出文档或网页(本地主机)中的所有方法和 class 就像 api 文档的样子..

如何实现?

谢谢

明确地说,您正在寻找某种方法来记录构成页面对象模型的所有 classes/methods?

这与 selenium 或 nunit 没有任何关系。只需使用 XML 文档注释记录您的 C# 代码,如下所示:

/// <summary>
/// This class does something.
/// </summary>
public class SomeClass
{
}

然后使用 DocFX or Sandcastle 之类的工具为您的文档生成 HTML 页。

来自微软(强调我的):

XML documentation comments are a special kind of comment, added above the definition of any user-defined type or member. They are special because they can be processed by the compiler to generate an XML documentation file at compile time. The compiler-generated XML file can be distributed alongside your .NET assembly so that Visual Studio and other IDEs can use IntelliSense to show quick information about types or members. Additionally, the XML file can be run through tools like DocFX and Sandcastle to generate API reference websites.

来源:https://docs.microsoft.com/en-us/dotnet/csharp/codedoc