zoukankan      html  css  js  c++  java
  • .net core 单元测试小记

    1. 创建项目,选择.net core的类库(class library)
    2. 修改project.json的配置
    {
      "version": "1.0.0-*",
      "testRunner": "xunit",
    
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        },
        "xunit": "2.2.0-beta4-build3444",
        "dotnet-test-xunit": "2.2.0-preview2-build1029",
        "xunit.runners": "2.0.0"
      },
    
      "frameworks": {
        "netcoreapp1.0": {
          "imports": [
            "dotnet54",
            "portable-net45+win8"
          ]
        }
      }
    
    }
    

      

      3.等包还原后,测试项目完成,可以开始写测试用例。

    PS:使用xunit、dotnet-test-xunit和xunit.runners,以后有新版本时可以在配置后再使用nuget自行更新。visual studio的测试资源管理器可以正确发现所有有测试用例。

    参考资料:https://docs.microsoft.com/en-us/dotnet/articles/core/testing/unit-testing-with-dotnet-test

  • 相关阅读:
    python基础-运算符和编码
    python介绍
    墨菲定律
    羊皮卷
    循环神经网络层
    ResNet实战
    ResNet实战
    ResNet,DenseNet
    经典卷积网络VGG,GoodLeNet,Inception
    CIFAR100与VGG13实战
  • 原文地址:https://www.cnblogs.com/dev2007/p/6144150.html
Copyright © 2011-2022 走看看