Skip to content

Commit

Permalink
Upgrade packages and to .NET 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
toxis committed Oct 23, 2024
1 parent a1f0f8e commit 4f4714f
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 69 deletions.
5 changes: 2 additions & 3 deletions BaseTests/Asynchronous/AsyncAwaitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace BaseTests.Asynchronous
{
[TestFixture]
public class AsyncAwaitTest
{
private string _tempFolder;
Expand All @@ -33,8 +32,8 @@ public async Task LongComputation()
long test = 99999999;
var result1 = await Compute(test, 5000);
var result2 = await Compute(test, 100);
Assert.AreEqual(result1, test);
Assert.AreEqual(result2, test);
Assert.That(result1, Is.EqualTo(test));
Assert.That(result2, Is.EqualTo(test));
}

private async Task<long> Compute(long counter, int delay)
Expand Down
64 changes: 40 additions & 24 deletions BaseTests/BaseTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\packages\NUnit.3.10.1\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.10.1\build\NUnit.props')" />
<Import Project="..\packages\NUnit.4.2.2\build\NUnit.props" Condition="Exists('..\packages\NUnit.4.2.2\build\NUnit.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BaseTests</RootNamespace>
<AssemblyName>BaseTests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
Expand All @@ -20,6 +19,7 @@
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -39,35 +39,52 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoFixture, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b24654c590009d4f, processorArchitecture=MSIL">
<HintPath>..\packages\AutoFixture.4.5.0\lib\net452\AutoFixture.dll</HintPath>
<Reference Include="AutoFixture, Version=4.18.0.0, Culture=neutral, PublicKeyToken=b24654c590009d4f, processorArchitecture=MSIL">
<HintPath>..\packages\AutoFixture.4.18.1\lib\net452\AutoFixture.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.4.3.1\lib\net45\Castle.Core.dll</HintPath>
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Fare, Version=2.1.0.0, Culture=neutral, PublicKeyToken=ea68d375bf33a7c8, processorArchitecture=MSIL">
<HintPath>..\packages\Fare.2.1.1\lib\net35\Fare.dll</HintPath>
<Reference Include="Fare, Version=2.2.0.0, Culture=neutral, PublicKeyToken=ea68d375bf33a7c8, processorArchitecture=MSIL">
<HintPath>..\packages\Fare.2.2.1\lib\net35\Fare.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.9.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.9.0\lib\net45\Moq.dll</HintPath>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Moq, Version=4.20.72.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.20.72\lib\net462\Moq.dll</HintPath>
</Reference>
<Reference Include="NFluent, Version=2.3.1.194, Culture=neutral, PublicKeyToken=18828b37b84b1437, processorArchitecture=MSIL">
<HintPath>..\packages\NFluent.2.3.1\lib\net45\NFluent.dll</HintPath>
<Reference Include="NFluent, Version=3.0.4.0, Culture=neutral, PublicKeyToken=18828b37b84b1437, processorArchitecture=MSIL">
<HintPath>..\packages\NFluent.3.0.4\lib\net46\NFluent.dll</HintPath>
</Reference>
<Reference Include="Ninject, Version=3.3.4.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.3.3.4\lib\net45\Ninject.dll</HintPath>
<Reference Include="Ninject, Version=3.3.6.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.3.3.6\lib\net45\Ninject.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.10.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=4.2.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.4.2.2\lib\net462\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunit.framework.legacy, Version=4.2.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.4.2.2\lib\net462\nunit.framework.legacy.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.3.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
</ItemGroup>
<Choose>
Expand All @@ -93,14 +110,14 @@
<Compile Include="Ninject\Formatter.cs" />
<Compile Include="Ninject\IStringFormatter.cs" />
<Compile Include="Ninject\NinjectTest.cs" />
<Compile Include="NUnitTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reflections\BaseReflectionTest.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Threading\" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Choose>
Expand All @@ -127,8 +144,7 @@
<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 http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.10.1\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.10.1\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\NUnit.4.2.2\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.4.2.2\build\NUnit.props'))" />
</Target>
<!-- 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.
Expand Down
10 changes: 4 additions & 6 deletions BaseTests/Delegates/BaseDelegateTest.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
using System;
using NUnit.Framework;
using NUnit.Framework;
using BaseTests.Common;

namespace BaseTests.Delegates
{
[TestFixture]
public class BaseDelegateTest
{
[Test]
public void EventHandlerTest()
{
var entity = new Entity<string>();
var initString = default(string);
Assert.AreEqual(entity.Data, initString);
Assert.That(entity.Data, Is.EqualTo(initString));

var oldValue = initString;
var newValue = "New Value";
entity.ValueChanged += (s, e) =>
{
Assert.AreEqual(e.OldValue, oldValue);
Assert.AreEqual(e.NewValue, newValue);
Assert.That(e.OldValue, Is.EqualTo(oldValue));
Assert.That(e.NewValue, Is.EqualTo(newValue));
};

entity.Data = newValue;
Expand Down
2 changes: 0 additions & 2 deletions BaseTests/Fixtures/FixtureTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using AutoFixture;
using NFluent;
using NUnit.Framework;
using System;
using System.Linq;

namespace BaseTests.Fixtures
{
Expand Down
15 changes: 0 additions & 15 deletions BaseTests/NUnitTest.cs

This file was deleted.

14 changes: 5 additions & 9 deletions BaseTests/Reflections/BaseReflectionTest.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
using BaseTests.Common;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BaseTests.Reflections
{
[TestFixture]
public class BaseReflectionTest
{
private Entity<string> _entity;
Expand All @@ -25,15 +20,16 @@ public void Setup()
public void PropertyTest()
{
var properties = _entity.GetType().GetProperties();
Assert.AreEqual(properties.Count(), 1);
Assert.That(properties.Count(), Is.EqualTo(1));

var propertyInfo = properties.Single();
Assert.AreEqual(propertyInfo.Name, nameof(_entity.Data));
Assert.That(propertyInfo.Name, Is.EqualTo(nameof(_entity.Data)));
var value = propertyInfo.GetValue(_entity);
Assert.AreEqual(value, HelloReflection);
Assert.That(value, Is.EqualTo(HelloReflection));

var newValue = "New Value";
propertyInfo.SetValue(_entity, newValue);
Assert.AreEqual(newValue, _entity.Data);
Assert.That(newValue, Is.EqualTo(_entity.Data));
}
}
}
19 changes: 19 additions & 0 deletions BaseTests/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Fare" publicKeyToken="ea68d375bf33a7c8" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
24 changes: 14 additions & 10 deletions BaseTests/packages.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoFixture" version="4.5.0" targetFramework="net452" />
<package id="Castle.Core" version="4.3.1" targetFramework="net452" />
<package id="Fare" version="2.1.1" targetFramework="net452" />
<package id="Moq" version="4.9.0" targetFramework="net452" />
<package id="NFluent" version="2.3.1" targetFramework="net452" />
<package id="Ninject" version="3.3.4" targetFramework="net452" />
<package id="NUnit" version="3.10.1" targetFramework="net452" />
<package id="NUnit3TestAdapter" version="3.10.0" targetFramework="net452" />
<package id="System.Threading.Tasks.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net452" />
<package id="AutoFixture" version="4.18.1" targetFramework="net48" />
<package id="Castle.Core" version="5.1.1" targetFramework="net48" />
<package id="Fare" version="2.2.1" targetFramework="net48" />
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net48" />
<package id="Moq" version="4.20.72" targetFramework="net48" />
<package id="NFluent" version="3.0.4" targetFramework="net48" />
<package id="Ninject" version="3.3.6" targetFramework="net48" />
<package id="NUnit" version="4.2.2" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
</packages>
8 changes: 8 additions & 0 deletions CSharpWorkspace.v3.ncrunchsolution
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<SolutionConfiguration>
<Settings>
<AllowParallelTestExecution>False</AllowParallelTestExecution>
<EnableRDI>False</EnableRDI>
<RdiConfigured>True</RdiConfigured>
<SolutionConfigured>True</SolutionConfigured>
</Settings>
</SolutionConfiguration>

0 comments on commit 4f4714f

Please sign in to comment.