Skip to content

Commit 6a4832e

Browse files
update csproj file for tests
1 parent 438c35a commit 6a4832e

File tree

11 files changed

+57
-209
lines changed

11 files changed

+57
-209
lines changed

Sources/LambdaConverters.Wpf/LambdaConverters.Wpf.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2525
<DebugType>pdbonly</DebugType>
26+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2627
<WarningsAsErrors />
2728
<AssemblyOriginatorKeyFile>Properties\LambdaConverters.public.snk</AssemblyOriginatorKeyFile>
2829
<SignAssembly>true</SignAssembly>

Sources/Tests.LambdaConverters.Wpf/AssemblyInfoTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Tests.LambdaConverters.Wpf
1212
[TestClass]
1313
public sealed class AssemblyInfoTests
1414
{
15-
[NotNull]
15+
[JetBrains.Annotations.NotNull]
1616
static Assembly Assembly => typeof(ValueConverter).Assembly;
1717

1818
[TestMethod]

Sources/Tests.LambdaConverters.Wpf/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 20 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,35 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProjectGuid>{D970C5FD-C274-4E2A-8BCC-D32AE16E9CFF}</ProjectGuid>
7-
<OutputType>Library</OutputType>
8-
<AppDesignerFolder>Properties</AppDesignerFolder>
9-
<RootNamespace>Tests.LambdaConverters.Wpf</RootNamespace>
10-
<AssemblyName>Tests.LambdaConverters.Wpf</AssemblyName>
11-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
12-
<FileAlignment>512</FileAlignment>
13-
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14-
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
15-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
16-
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
17-
<IsCodedUITest>False</IsCodedUITest>
18-
<TestProjectType>UnitTest</TestProjectType>
19-
<TargetFrameworkProfile />
4+
<TargetFrameworks>netcoreapp3.0;net46;net45</TargetFrameworks>
5+
<UseWPF>true</UseWPF>
206
</PropertyGroup>
7+
218
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
22-
<DebugSymbols>true</DebugSymbols>
23-
<DebugType>full</DebugType>
24-
<Optimize>false</Optimize>
25-
<OutputPath>bin\Debug\</OutputPath>
9+
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
2610
<DefineConstants>DEBUG;TRACE</DefineConstants>
27-
<ErrorReport>prompt</ErrorReport>
28-
<WarningLevel>4</WarningLevel>
29-
<Prefer32Bit>false</Prefer32Bit>
3011
</PropertyGroup>
12+
3113
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3214
<DebugType>pdbonly</DebugType>
33-
<Optimize>true</Optimize>
34-
<OutputPath>bin\Release\</OutputPath>
35-
<DefineConstants>TRACE</DefineConstants>
36-
<ErrorReport>prompt</ErrorReport>
37-
<WarningLevel>4</WarningLevel>
38-
<Prefer32Bit>false</Prefer32Bit>
15+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
16+
<WarningsAsErrors />
3917
</PropertyGroup>
18+
19+
<Import Project="..\Tests.Shared\Tests.Shared.projitems" Label="Shared" />
20+
4021
<ItemGroup>
41-
<Reference Include="JetBrains.Annotations, Version=11.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
42-
<HintPath>..\packages\JetBrains.Annotations.11.0.0\lib\net20\JetBrains.Annotations.dll</HintPath>
43-
</Reference>
44-
<Reference Include="PresentationFramework" />
45-
<Reference Include="System" />
46-
<Reference Include="System.Core">
47-
<RequiredTargetFramework>3.5</RequiredTargetFramework>
48-
</Reference>
49-
<Reference Include="System.Xaml" />
50-
<Reference Include="WindowsBase" />
51-
</ItemGroup>
52-
<Choose>
53-
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
54-
<ItemGroup>
55-
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
56-
</ItemGroup>
57-
</When>
58-
<Otherwise>
59-
<ItemGroup>
60-
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
61-
</ItemGroup>
62-
</Otherwise>
63-
</Choose>
64-
<ItemGroup>
65-
<Compile Include="AssemblyInfoTests.cs" />
66-
<Compile Include="MultiValueConverterTests.cs" />
67-
<Compile Include="Properties\AssemblyInfo.cs" />
68-
<Compile Include="TemplateSelectorTests.cs" />
69-
<Compile Include="ValidationRuleTests.cs" />
70-
<Compile Include="ValueConverterTests.cs" />
22+
<PackageReference Include="JetBrains.Annotations" Version="11.0.0" />
23+
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0" />
24+
<PackageReference Include="MSTest.TestFramework" Version="2.0.0" />
7125
</ItemGroup>
26+
7227
<ItemGroup>
73-
<ProjectReference Include="..\LambdaConverters.Wpf\LambdaConverters.Wpf.csproj">
74-
<Project>{8DE93D00-4B56-424B-AA7D-02C4A4A41F0D}</Project>
75-
<Name>LambdaConverters.Wpf</Name>
76-
</ProjectReference>
28+
<ProjectReference Include="..\LambdaConverters.Wpf\LambdaConverters.Wpf.csproj" />
7729
</ItemGroup>
30+
7831
<ItemGroup>
79-
<None Include="packages.config">
80-
<SubType>Designer</SubType>
81-
</None>
32+
<Folder Include="Properties\" />
8233
</ItemGroup>
83-
<Choose>
84-
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
85-
<ItemGroup>
86-
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
87-
<Private>False</Private>
88-
</Reference>
89-
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
90-
<Private>False</Private>
91-
</Reference>
92-
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
93-
<Private>False</Private>
94-
</Reference>
95-
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
96-
<Private>False</Private>
97-
</Reference>
98-
</ItemGroup>
99-
</When>
100-
</Choose>
101-
<Import Project="..\Tests.Shared\Tests.Shared.projitems" Label="Shared" />
102-
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
103-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
104-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
105-
Other similar extension points exist, see Microsoft.Common.targets.
106-
<Target Name="BeforeBuild">
107-
</Target>
108-
<Target Name="AfterBuild">
109-
</Target>
110-
-->
34+
11135
</Project>

Sources/Tests.LambdaConverters.Wpf/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

Sources/Tests.Shared/AssemblyAssert.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
using System.Diagnostics.CodeAnalysis;
33
using System.IO;
44
using System.Reflection;
5-
using JetBrains.Annotations;
65
using Microsoft.VisualStudio.TestTools.UnitTesting;
76

87
namespace Tests.Shared
98
{
109
[ExcludeFromCodeCoverage]
1110
internal static class AssemblyAssert
1211
{
13-
[NotNull]
12+
[JetBrains.Annotations.NotNull]
1413
static string GetAttributeName<A>() where A : Attribute
1514
{
1615
var name = typeof(A).Name;
@@ -20,7 +19,7 @@ static string GetAttributeName<A>() where A : Attribute
2019
name.EndsWith(nameof(Attribute), StringComparison.Ordinal) ? name.Remove(name.Length - nameof(Attribute).Length) : name);
2120
}
2221

23-
public static void AreAttributesValid([NotNull] Assembly assembly)
22+
public static void AreAttributesValid([JetBrains.Annotations.NotNull] Assembly assembly)
2423
{
2524
var copyrightAttribute = assembly.GetCustomAttribute<AssemblyCopyrightAttribute>();
2625

Sources/Tests.Shared/ExceptionAssert.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace Tests.Shared
1111
[SuppressMessage("ReSharper", "UncatchableException")]
1212
internal static class ExceptionAssert
1313
{
14-
[NotNull]
15-
static E Handle<E>([NotNull] E exception, string expectedParamName = null) where E : Exception
14+
[JetBrains.Annotations.NotNull]
15+
static E Handle<E>([JetBrains.Annotations.NotNull] E exception, string expectedParamName = null) where E : Exception
1616
{
1717
var argumentException = exception as ArgumentException;
1818
if (argumentException != null)
@@ -41,8 +41,8 @@ static E Handle<E>([NotNull] E exception, string expectedParamName = null) where
4141
return exception;
4242
}
4343

44-
[NotNull]
45-
public static E Throws<E>([NotNull] [InstantHandle] Action action, string expectedParamName = null) where E : Exception
44+
[JetBrains.Annotations.NotNull]
45+
public static E Throws<E>([JetBrains.Annotations.NotNull] [InstantHandle] Action action, string expectedParamName = null) where E : Exception
4646
{
4747
try
4848
{

Sources/Tests.Shared/SequenceAssert.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ namespace Tests.Shared
1111
internal static class SequenceAssert
1212
{
1313
[Pure]
14-
static bool AreEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<T, T, bool> equalityComparer, [NotNull] out string reason)
14+
static bool AreEqual<T>(
15+
IEnumerable<T> expected,
16+
IEnumerable<T> actual,
17+
Func<T, T, bool> equalityComparer,
18+
[JetBrains.Annotations.NotNull] out string reason)
1519
{
1620
if (ReferenceEquals(expected, actual))
1721
{
@@ -61,7 +65,10 @@ static bool AreEqual<T>(IEnumerable<T> expected, IEnumerable<T> actual, Func<T,
6165
}
6266

6367
[SuppressMessage("ReSharper", "UnusedParameter.Global")]
64-
public static void DoesNotContain<T>([NotNull] IEnumerable<T> sequence, T item, IEqualityComparer<T> equalityComparer = null)
68+
public static void DoesNotContain<T>(
69+
[JetBrains.Annotations.NotNull] IEnumerable<T> sequence,
70+
T item,
71+
IEqualityComparer<T> equalityComparer = null)
6572
{
6673
if (sequence.Contains(item, equalityComparer))
6774
{

Sources/Tests.Shared/StructAssert.cs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace Tests.Shared
1010
internal static class StructAssert
1111
{
1212
static void AssertOverridesMethod(
13-
[NotNull] this Type type,
14-
[NotNull] string name,
15-
[NotNull] [ItemNotNull] Type[] parameterTypes,
13+
[JetBrains.Annotations.NotNull] this Type type,
14+
[JetBrains.Annotations.NotNull] string name,
15+
[JetBrains.Annotations.NotNull] [ItemNotNull] Type[] parameterTypes,
1616
Type returnType)
1717
{
1818
var method = type.GetMethod(
@@ -29,9 +29,9 @@ static void AssertOverridesMethod(
2929
}
3030

3131
static void AssertHasStaticMethod(
32-
[NotNull] this Type type,
33-
[NotNull] string name,
34-
[NotNull] [ItemNotNull] Type[] parameterTypes,
32+
[JetBrains.Annotations.NotNull] this Type type,
33+
[JetBrains.Annotations.NotNull] string name,
34+
[JetBrains.Annotations.NotNull] [ItemNotNull] Type[] parameterTypes,
3535
Type returnType,
3636
bool isOperator)
3737
{
@@ -48,7 +48,11 @@ static void AssertHasStaticMethod(
4848
Assert.AreEqual(isOperator, method.IsSpecialName);
4949
}
5050

51-
static void AssertDoesNotHaveStaticMethod([NotNull] this Type type, [NotNull] string name, [NotNull] [ItemNotNull] Type[] parameterTypes)
51+
static void AssertDoesNotHaveStaticMethod(
52+
[JetBrains.Annotations.NotNull] this Type type,
53+
[JetBrains.Annotations.NotNull] string name,
54+
[JetBrains.Annotations.NotNull][ItemNotNull]
55+
Type[] parameterTypes)
5256
{
5357
var method = type.GetMethod(
5458
name,
@@ -99,17 +103,22 @@ public static void IsCorrect<T>(bool mustBeComparable = false) where T : struct
99103
}
100104
}
101105

102-
public static void AreEqual<T>(T value, [NotNull] Func<T, T, bool> equalityOperator, [NotNull] Func<T, T, bool> inequalityOperator)
103-
where T : struct, IEquatable<T>
106+
public static void AreEqual<T>(
107+
T value,
108+
[JetBrains.Annotations.NotNull] Func<T, T, bool> equalityOperator,
109+
[JetBrains.Annotations.NotNull] Func<T, T, bool> inequalityOperator) where T : struct, IEquatable<T>
104110
{
105111
Assert.IsTrue(value.Equals(value));
106112
Assert.IsTrue(value.Equals(value as object));
107113
Assert.IsTrue(equalityOperator(value, value)); // value == value
108114
Assert.IsFalse(inequalityOperator(value, value)); // value != value
109115
}
110116

111-
public static void AreNotEqual<T>(T x, T y, [NotNull] Func<T, T, bool> equalityOperator, [NotNull] Func<T, T, bool> inequalityOperator)
112-
where T : struct, IEquatable<T>
117+
public static void AreNotEqual<T>(
118+
T x,
119+
T y,
120+
[JetBrains.Annotations.NotNull] Func<T, T, bool> equalityOperator,
121+
[JetBrains.Annotations.NotNull] Func<T, T, bool> inequalityOperator) where T : struct, IEquatable<T>
113122
{
114123
Assert.IsFalse(x.Equals(y));
115124
Assert.IsFalse(y.Equals(x));

Sources/Tests.Shared/TestController.cs

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)