05052c0541
To ensure the mock has the same behavior the component has, run mock under the same tests the adapter has. It is a common problem that moq has -- "everything is mocked out, you are not test anything"
87 lines
5.1 KiB
XML
87 lines
5.1 KiB
XML
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>$(CliTargetFramework)</TargetFramework>
|
|
<RuntimeFrameworkVersion>$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion>
|
|
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
|
<AssemblyName>dotnet.Tests</AssemblyName>
|
|
<AssemblyOriginatorKeyFile>../../tools/Key.snk</AssemblyOriginatorKeyFile>
|
|
<SignAssembly>true</SignAssembly>
|
|
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
|
|
<AssetTargetFallback>$(AssetTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8</AssetTargetFallback>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<Content Include="..\..\TestAssets\TestProjects\AppWithToolDependency\**\*">
|
|
<Link>TestAssets/TestProjects/AppWithToolDependency/%(RecursiveDir)%(Filename)%(Extension)</Link>
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
|
</Content>
|
|
<Content Include="..\..\TestAssets\TestProjects\DependencyContextFromTool\**\*">
|
|
<Link>TestAssets/TestProjects/DependencyContextFromTool/%(RecursiveDir)%(Filename)%(Extension)</Link>
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
|
</Content>
|
|
</ItemGroup>
|
|
|
|
<Target Name="WriteExpectedVersion"
|
|
BeforeTargets="BeforeBuild"
|
|
DependsOnTargets="PrepareForBuild">
|
|
|
|
<PropertyGroup>
|
|
<ExpectedVersionFileInIntermediateFolder>$(IntermediateOutputPath)ExpectedSdkVersion.txt</ExpectedVersionFileInIntermediateFolder>
|
|
|
|
<VersionFileContent>$(SdkVersion)</VersionFileContent>
|
|
<ExistingVersionFileContent Condition=" Exists('$(ExpectedVersionFileInIntermediateFolder)') ">
|
|
$([System.IO.File]::ReadAllText($(ExpectedVersionFileInIntermediateFolder)))
|
|
</ExistingVersionFileContent>
|
|
|
|
<ShouldOverwriteVersionFile>false</ShouldOverwriteVersionFile>
|
|
<ShouldOverwriteVersionFile
|
|
Condition=" '$(ExistingVersionFileContent.Trim())' != '$(VersionFileContent.Trim())' ">true</ShouldOverwriteVersionFile>
|
|
</PropertyGroup>
|
|
|
|
<WriteLinesToFile File="$(ExpectedVersionFileInIntermediateFolder)"
|
|
Lines="$(VersionFileContent)"
|
|
Condition=" '$(ShouldOverwriteVersionFile)' == 'true' "
|
|
Overwrite="true" />
|
|
|
|
<ItemGroup>
|
|
<Content Include="$(ExpectedVersionFileInIntermediateFolder)" CopyToOutputDirectory="PreserveNewest" />
|
|
<FileWrites Include="$(ExpectedVersionFileInIntermediateFolder)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="WriteExpectedTargetFrameworkMoniker" BeforeTargets="BeforeBuild" DependsOnTargets="PrepareForBuild">
|
|
<PropertyGroup>
|
|
<ExpectedTargetFrameworkMonikerFileInIntermediateFolder>$(IntermediateOutputPath)ExpectedTargetFrameworkMoniker.txt</ExpectedTargetFrameworkMonikerFileInIntermediateFolder>
|
|
<VersionFileContent>$(TargetFrameworkMoniker)</VersionFileContent>
|
|
<ExistingVersionFileContent Condition=" Exists('$(ExpectedTargetFrameworkMonikerFileInIntermediateFolder)') ">
|
|
$([System.IO.File]::ReadAllText($(ExpectedTargetFrameworkMonikerFileInIntermediateFolder)))
|
|
</ExistingVersionFileContent>
|
|
<ShouldOverwriteVersionFile>false</ShouldOverwriteVersionFile>
|
|
<ShouldOverwriteVersionFile Condition=" '$(ExistingVersionFileContent.Trim())' != '$(VersionFileContent.Trim())' ">true</ShouldOverwriteVersionFile>
|
|
</PropertyGroup>
|
|
<WriteLinesToFile File="$(ExpectedTargetFrameworkMonikerFileInIntermediateFolder)" Lines="$(VersionFileContent)" Condition=" '$(ShouldOverwriteVersionFile)' == 'true' " Overwrite="true" />
|
|
<ItemGroup>
|
|
<Content Include="$(ExpectedTargetFrameworkMonikerFileInIntermediateFolder)" CopyToOutputDirectory="PreserveNewest" />
|
|
<FileWrites Include="$(ExpectedTargetFrameworkMonikerFileInIntermediateFolder)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<ItemGroup>
|
|
<ProjectReference Include="..\Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj" />
|
|
<ProjectReference Include="..\Microsoft.DotNet.Tools.Tests.ComponentMocks\Microsoft.DotNet.Tools.Tests.ComponentMocks.csproj" />
|
|
<ProjectReference Include="..\..\src\dotnet\dotnet.csproj" />
|
|
<ProjectReference Include="..\..\src\Microsoft.DotNet.Cli.Sln.Internal\Microsoft.DotNet.Cli.Sln.Internal.csproj" />
|
|
<ProjectReference Include="..\..\src\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
|
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
|
<PackageReference Include="xunit" Version="2.2.0" />
|
|
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="$(MicrosoftDotNetPlatformAbstractionsPackageVersion)" />
|
|
<PackageReference Include="Microsoft.DotNet.Cli.CommandLine" Version="$(MicrosoftDotNetCliCommandLinePackageVersion)" />
|
|
</ItemGroup>
|
|
</Project>
|