Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating for Visual Studio 2022 #46

Merged
merged 5 commits into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 12 additions & 28 deletions CreateUnitTests.NUnit/CreateUnitTests.NUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -10,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TestGeneration.Extensions.NUnit</RootNamespace>
<AssemblyName>TestGeneration.Extensions.NUnit</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
Expand All @@ -35,22 +34,19 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="envdte80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="envdte, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="envdte80, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestGeneration">
<HintPath>c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestGeneration\Microsoft.VisualStudio.TestPlatform.TestGeneration.dll</HintPath>
<HintPath>c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestGeneration\Microsoft.VisualStudio.TestPlatform.TestGeneration.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestGeneration.Extensions">
<HintPath>c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestGeneration\Microsoft.VisualStudio.TestPlatform.TestGeneration.Extensions.dll</HintPath>
<HintPath>c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestGeneration\Microsoft.VisualStudio.TestPlatform.TestGeneration.Extensions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestGeneration.Package">
<HintPath>c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestGeneration\Microsoft.VisualStudio.TestPlatform.TestGeneration.Package.dll</HintPath>
<HintPath>c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestGeneration\Microsoft.VisualStudio.TestPlatform.TestGeneration.Package.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
Expand All @@ -62,12 +58,6 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="VSLangProj, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="VSLangProj80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="NUnit2FrameworkProvider.cs" />
Expand All @@ -79,19 +69,13 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<PackageReference Include="Microsoft.VSSDK.BuildTools">
<Version>17.4.2119</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see https://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
4 changes: 3 additions & 1 deletion CreateUnitTests.NUnit/NUnit2SolutionManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ***********************************************************************
// ***********************************************************************
// Copyright (c) 2015-2018 Terje Sandstrom
//
// Permission is hereby granted, free of charge, to any person obtaining
Expand Down Expand Up @@ -39,6 +39,7 @@ public class NUnit2SolutionManager : SolutionManagerBase
{
private const string NUnitVersion = "2.6.4";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private const string NUnitVersion = "2.6.4";
private const string NUnitVersion = "2.7.1";

private const string NunitAdapterVersion = "2.2.0";
OsirisTerje marked this conversation as resolved.
Show resolved Hide resolved
private const string TestSDKVersion = "17.4.1";

/// <summary>
/// Initializes a new instance of the <see cref="NUnit2SolutionManager"/> class.
Expand Down Expand Up @@ -68,6 +69,7 @@ protected override void OnUnitTestProjectCreated(Project unitTestProject, CodeFu
base.OnUnitTestProjectCreated(unitTestProject, sourceMethod);
EnsureNuGetReference(unitTestProject, "NUnit", NUnitVersion);
EnsureNuGetReference(unitTestProject, "NUnitTestAdapter", NunitAdapterVersion);
EnsureNuGetReference(unitTestProject, "Microsoft.NET.Test.Sdk", TestSDKVersion);

var vsp = unitTestProject.Object as VSProject2;
var reference = vsp?.References.Find(GlobalConstants.MSTestAssemblyName);
Expand Down
6 changes: 4 additions & 2 deletions CreateUnitTests.NUnit/NUnit3SolutionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ namespace TestGeneration.Extensions.NUnit
{
public class NUnit3SolutionManager : SolutionManagerBase
{
private const string NUnitVersion = "3.12.0";
private const string NunitAdapterVersion = "3.15.1";
private const string NUnitVersion = "3.13.3";
private const string NunitAdapterVersion = "4.3.1";
private const string TestSDKVersion = "17.4.1";

/// <summary>
/// Initializes a new instance of the <see cref="NUnit3SolutionManager"/> class.
Expand Down Expand Up @@ -64,6 +65,7 @@ protected override void OnUnitTestProjectCreated(Project unitTestProject, CodeFu
base.OnUnitTestProjectCreated(unitTestProject, sourceMethod);
this.EnsureNuGetReference(unitTestProject, "NUnit", NUnitVersion);
this.EnsureNuGetReference(unitTestProject, "NUnit3TestAdapter", NunitAdapterVersion);
this.EnsureNuGetReference(unitTestProject, "Microsoft.NET.Test.Sdk", TestSDKVersion);

var vsp = unitTestProject.Object as VSProject2;
var reference = vsp?.References.Find(GlobalConstants.MSTestAssemblyName);
Expand Down
4 changes: 0 additions & 4 deletions CreateUnitTests.NUnit/packages.config

This file was deleted.

10 changes: 5 additions & 5 deletions IntelliTest.NUnit/IntelliTest.NUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand All @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TestGeneration.Extensions.IntelliTest.NUnit</RootNamespace>
<AssemblyName>TestGeneration.Extensions.IntelliTest.NUnit</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -34,15 +34,15 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.ExtendedReflection">
<HintPath>D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\Pex\Microsoft.ExtendedReflection.dll</HintPath>
<HintPath>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\Pex\Microsoft.ExtendedReflection.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.ExtendedReflection.Reasoning">
<HintPath>D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\Pex\Microsoft.ExtendedReflection.Reasoning.dll</HintPath>
<HintPath>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\Pex\Microsoft.ExtendedReflection.Reasoning.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Pex.Framework">
<HintPath>D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\Pex\Microsoft.Pex.Framework.dll</HintPath>
<HintPath>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\Pex\Microsoft.Pex.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
Expand Down
7 changes: 1 addition & 6 deletions IntelliTest.NUnit/NUnit3TestFramework.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ***********************************************************************
// ***********************************************************************
// Copyright (c) 2015-2018 Terje Sandstrom
//
// Permission is hereby granted, free of charge, to any person obtaining
Expand Down Expand Up @@ -133,11 +133,6 @@ public override bool SupportsProjectBitness(Bitness bitness)
return true;
}

/// <summary>
/// The _expected exception attribute.
/// </summary>
[NonSerialized] TypeName expectedExceptionAttribute;

/// <summary>
/// Gets the ExpectedException attribute.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand All @@ -24,7 +23,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TestGeneration.Extensions.NUnit</RootNamespace>
<AssemblyName>TestGeneration.Extensions.NUnit</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
Expand Down Expand Up @@ -53,7 +52,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
Expand Down Expand Up @@ -86,14 +84,6 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see https://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
4 changes: 2 additions & 2 deletions TestGeneration.Extensions.NUnit/license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)
The MIT License (MIT)

Copyright (c) 2015-2019 Terje Sandstrom
Copyright (c) 2015-2022 Terje Sandstrom

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 0 additions & 4 deletions TestGeneration.Extensions.NUnit/packages.config

This file was deleted.

10 changes: 6 additions & 4 deletions TestGeneration.Extensions.NUnit/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="TestGeneration.Extensions.NUnit.113f61ed-a246-4431-809d-bcd393642599" Version="2.3" Language="en-US" Publisher="Terje Sandstrom" />
<DisplayName>Test Generator NUnit extension</DisplayName>
<Identity Id="TestGeneration.Extensions.NUnit.de03c1c9-a95a-4098-ac1b-7a66d50fae60" Version="3.0" Language="en-US" Publisher="Terje Sandstrom" />
<DisplayName>NUnit Test Generator VS2022</DisplayName>
<Description xml:space="preserve">Test Generator, NUnit extensions for Visual Studio.
Creates Unit tests and Intellitests with both NUnit 2.6.4 and NUnit 3 frameworks.
Works on Visual Studio from version 2017.
Works on Visual Studio from version 2022.
</Description>
<MoreInfo>https://github.com/nunit/nunit-vs-testgenerator</MoreInfo>
<License>license.txt</License>
Expand All @@ -16,7 +16,9 @@ Works on Visual Studio from version 2017.
<Tags>unit testing, NUnit</Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,17.0)" />
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
Expand Down