Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2b7b0f12

Přidáno uživatelem Roman Kalivoda před téměř 4 roky(ů)

Re #9009 Migrate test project

Zobrazit rozdíly:

Server/ServerApp.sln
7 7
EndProject
8 8
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject", "TestProject\TestProject.csproj", "{8A09DB8E-64B1-4D55-991E-7F7B21996B45}"
9 9
EndProject
10
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerAppTests", "ServerAppTests\ServerAppTests.csproj", "{E068474B-98FB-431D-84EB-000AA36D0FC5}"
10
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerAppUnitTests", "ServerAppTests\ServerAppUnitTests.csproj", "{125F0CBB-3B8D-45B7-8069-29CFB1416E63}"
11 11
EndProject
12 12
Global
13 13
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
33 33
		{8A09DB8E-64B1-4D55-991E-7F7B21996B45}.Release|Any CPU.Build.0 = Release|Any CPU
34 34
		{8A09DB8E-64B1-4D55-991E-7F7B21996B45}.Release|x64.ActiveCfg = Release|Any CPU
35 35
		{8A09DB8E-64B1-4D55-991E-7F7B21996B45}.Release|x64.Build.0 = Release|Any CPU
36
		{E068474B-98FB-431D-84EB-000AA36D0FC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37
		{E068474B-98FB-431D-84EB-000AA36D0FC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
38
		{E068474B-98FB-431D-84EB-000AA36D0FC5}.Debug|x64.ActiveCfg = Debug|Any CPU
39
		{E068474B-98FB-431D-84EB-000AA36D0FC5}.Debug|x64.Build.0 = Debug|Any CPU
40
		{E068474B-98FB-431D-84EB-000AA36D0FC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
41
		{E068474B-98FB-431D-84EB-000AA36D0FC5}.Release|Any CPU.Build.0 = Release|Any CPU
42
		{E068474B-98FB-431D-84EB-000AA36D0FC5}.Release|x64.ActiveCfg = Release|Any CPU
43
		{E068474B-98FB-431D-84EB-000AA36D0FC5}.Release|x64.Build.0 = Release|Any CPU
36
		{125F0CBB-3B8D-45B7-8069-29CFB1416E63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37
		{125F0CBB-3B8D-45B7-8069-29CFB1416E63}.Debug|Any CPU.Build.0 = Debug|Any CPU
38
		{125F0CBB-3B8D-45B7-8069-29CFB1416E63}.Debug|x64.ActiveCfg = Debug|Any CPU
39
		{125F0CBB-3B8D-45B7-8069-29CFB1416E63}.Debug|x64.Build.0 = Debug|Any CPU
40
		{125F0CBB-3B8D-45B7-8069-29CFB1416E63}.Release|Any CPU.ActiveCfg = Release|Any CPU
41
		{125F0CBB-3B8D-45B7-8069-29CFB1416E63}.Release|Any CPU.Build.0 = Release|Any CPU
42
		{125F0CBB-3B8D-45B7-8069-29CFB1416E63}.Release|x64.ActiveCfg = Release|Any CPU
43
		{125F0CBB-3B8D-45B7-8069-29CFB1416E63}.Release|x64.Build.0 = Release|Any CPU
44 44
	EndGlobalSection
45 45
	GlobalSection(SolutionProperties) = preSolution
46 46
		HideSolutionNode = FALSE
Server/ServerAppTests/Predictor/PredictionControllerTests.cs
1
//
2
// Author: Roman Kalivoda
3
//
4
using Microsoft.VisualStudio.TestTools.UnitTesting;
1
using Microsoft.VisualStudio.TestTools.UnitTesting;
5 2
using ServerApp.Predictor;
6 3
using System;
7 4
using System.Collections.Generic;
......
14 11
    [TestClass()]
15 12
    public class PredictionControllerTests
16 13
    {
17
        [TestInitialize]
18
        public void SetUp()
14
        [TestMethod()]
15
        public void PredictionControllerTest()
16
        {
17
            throw new NotImplementedException();
18
        }
19

  
20
        [TestMethod()]
21
        public void GetPredictorsTest()
22
        {
23
            throw new NotImplementedException();
24
        }
25

  
26
        [TestMethod()]
27
        public void LoadTest()
19 28
        {
29
            throw new NotImplementedException();
30
        }
20 31

  
32
        [TestMethod()]
33
        public void PredictTest()
34
        {
35
            throw new NotImplementedException();
21 36
        }
22 37

  
23 38
        [TestMethod()]
Server/ServerAppTests/ServerAppTests.csproj
1
<?xml version="1.0" encoding="utf-8"?>
2
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
  <Import Project="..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" />
4
  <PropertyGroup>
5
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
    <ProjectGuid>{E068474B-98FB-431D-84EB-000AA36D0FC5}</ProjectGuid>
8
    <OutputType>Library</OutputType>
9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10
    <RootNamespace>ServerAppTests</RootNamespace>
11
    <AssemblyName>ServerAppTests</AssemblyName>
12
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13
    <FileAlignment>512</FileAlignment>
14
    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
15
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
16
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
17
    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
18
    <IsCodedUITest>False</IsCodedUITest>
19
    <TestProjectType>UnitTest</TestProjectType>
20
    <TargetFrameworkProfile />
21
    <NuGetPackageImportStamp>
22
    </NuGetPackageImportStamp>
23
  </PropertyGroup>
24
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25
    <DebugSymbols>true</DebugSymbols>
26
    <DebugType>full</DebugType>
27
    <Optimize>false</Optimize>
28
    <OutputPath>bin\Debug\</OutputPath>
29
    <DefineConstants>DEBUG;TRACE</DefineConstants>
30
    <ErrorReport>prompt</ErrorReport>
31
    <WarningLevel>4</WarningLevel>
32
  </PropertyGroup>
33
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
34
    <DebugType>pdbonly</DebugType>
35
    <Optimize>true</Optimize>
36
    <OutputPath>bin\Release\</OutputPath>
37
    <DefineConstants>TRACE</DefineConstants>
38
    <ErrorReport>prompt</ErrorReport>
39
    <WarningLevel>4</WarningLevel>
40
  </PropertyGroup>
41
  <ItemGroup>
42
    <Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
43
      <HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
44
    </Reference>
45
    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
46
      <HintPath>..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
47
    </Reference>
48
    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
49
      <HintPath>..\packages\MSTest.TestFramework.2.1.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
50
    </Reference>
51
    <Reference Include="Moq, Version=4.16.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
52
      <HintPath>..\packages\Moq.4.16.1\lib\net45\Moq.dll</HintPath>
53
    </Reference>
54
    <Reference Include="System" />
55
    <Reference Include="System.Configuration" />
56
    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
57
      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
58
    </Reference>
59
    <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
60
      <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
61
    </Reference>
62
  </ItemGroup>
63
  <Choose>
64
    <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
65
      <ItemGroup>
66
        <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
67
      </ItemGroup>
68
    </When>
69
    <Otherwise />
70
  </Choose>
71
  <ItemGroup>
72
    <Compile Include="Predictor\PredictionControllerTests.cs" />
73
    <Compile Include="Properties\AssemblyInfo.cs" />
74
  </ItemGroup>
75
  <ItemGroup>
76
    <None Include="app.config" />
77
    <None Include="packages.config" />
78
  </ItemGroup>
79
  <ItemGroup>
80
    <ProjectReference Include="..\ServerApp\ServerApp.csproj">
81
      <Project>{18FCFB20-B860-4147-8E7C-8A0DD84C55D4}</Project>
82
      <Name>ServerApp</Name>
83
    </ProjectReference>
84
  </ItemGroup>
85
  <Choose>
86
    <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
87
      <ItemGroup>
88
        <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
89
          <Private>False</Private>
90
        </Reference>
91
        <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
92
          <Private>False</Private>
93
        </Reference>
94
        <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
95
          <Private>False</Private>
96
        </Reference>
97
        <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
98
          <Private>False</Private>
99
        </Reference>
100
      </ItemGroup>
101
    </When>
102
  </Choose>
103
  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
104
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
105
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
106
    <PropertyGroup>
107
      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
108
    </PropertyGroup>
109
    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.props'))" />
110
    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets'))" />
111
  </Target>
112
  <Import Project="..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.1\build\net45\MSTest.TestAdapter.targets')" />
113
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
114
       Other similar extension points exist, see Microsoft.Common.targets.
115
  <Target Name="BeforeBuild">
116
  </Target>
117
  <Target Name="AfterBuild">
118
  </Target>
119
  -->
120
</Project>
Server/ServerAppTests/ServerAppUnitTests.csproj
1
<Project Sdk="Microsoft.NET.Sdk">
2

  
3
  <PropertyGroup>
4
    <TargetFramework>.NETCoreApp,Version=v5.0</TargetFramework>
5

  
6
    <IsPackable>false</IsPackable>
7
  </PropertyGroup>
8

  
9
  <ItemGroup>
10
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
11
    <PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
12
    <PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
13
    <PackageReference Include="coverlet.collector" Version="1.2.0" />
14
  </ItemGroup>
15

  
16
  <ItemGroup>
17
    <ProjectReference Include="..\ServerApp\ServerApp.csproj" />
18
  </ItemGroup>
19

  
20
</Project>
Server/ServerAppTests/app.config
1
<?xml version="1.0" encoding="utf-8"?>
2
<configuration>
3
  <runtime>
4
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5
      <dependentAssembly>
6
        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
7
        <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
8
      </dependentAssembly>
9
    </assemblyBinding>
10
  </runtime>
11
</configuration>
Server/ServerAppTests/packages.config
1
<?xml version="1.0" encoding="utf-8"?>
2
<packages>
3
  <package id="Castle.Core" version="4.4.0" targetFramework="net472" />
4
  <package id="Moq" version="4.16.1" targetFramework="net472" />
5
  <package id="MSTest.TestAdapter" version="2.1.1" targetFramework="net472" />
6
  <package id="MSTest.TestFramework" version="2.1.1" targetFramework="net472" />
7
  <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net472" />
8
  <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
9
</packages>

Také k dispozici: Unified diff