zoukankan      html  css  js  c++  java
  • .NET Core 单元测试相关命令

    使用的PowerShell命令

    1.创建项目相关命令

    ls 

    mkdir

    ni (new-item) 创建空文件

    add-content  向文件添加内容

    type 打开文件

    dotnet new sln 创建空解决方案

    dotnet sln add *.csproj 向解决方案添加项目

    dotnet new classlib 创建程序集

    dotnet new mstest (创建MSTest项目)

    dotnet add reference *.csproj (当前程序集添加其他程序及引用)

    2.执行测试相关命令

    dotnet test 执行所有

    测试

    dotnet test --filter Method (执行完整名字包含Method 的测试方法)

    dotnet test --filter Name~TestMethod1 (运行名称中包含TestMethod1的方法)

    dotnet test --filter ClassName=MSTestNamespace.UnitTest1 (运行MSTestNamespace.UnitTest1类中的测试)

    dotnet test --filter FullyQualifiedName!=MSTestNamespace.UnitTest1.TestMethod1 (运行MSTestNamespace.UnitTest1.TestMethod1之外所有测试)

    dotnet test --filter TestCategory=CategoryA (运行含 [TestCategory("CategoryA")] 批注的测试。)

    dotnet test --filter Priority=2  (运行含 [Priority(2)] 批注的测试。)

    dotnet vstest <MyPublishedTests>.dll 对发布过的测试项目运行测试 (如果你的应用以 netcoreapp 之外的框架为目标,则仍然可以通过使用框架标志传入目标框架来运行 dotnet vstest 命令。 如:dotnet vstest <MyPublishedTests>.dll --Framework:".NETFramework,Version=v4.6")

  • 相关阅读:
    iOS委托传值
    关于异步和多线程的关系
    删除xcode中的插件
    iOS Xcode常用插件
    关于ECSlidingViewController的使用
    iOS去掉tableview中无内容的cell
    iOS中block用法之两个界面传值问题
    cocoapods管理第三方类库
    在GitHub托管代码-终端命令
    vsCode快捷键
  • 原文地址:https://www.cnblogs.com/fmys/p/10206411.html
Copyright © 2011-2022 走看看