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

Remove obsolete framework versions and update tests to .NET 8 #30

10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET 5
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Setup .NET CORE
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
dotnet-version: '8.x.x'
- name: Restore dependencies
run: dotnet restore OnixDataStandard.sln
- name: Build
Expand All @@ -25,7 +21,7 @@ jobs:
run: dotnet test OnixDataStandard.sln --no-build --verbosity normal --logger trx /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov
/p:Exclude=\"[OnixData.Standard.BaseTests]*\" /p:ExcludeByAttribute=\"Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute\"
- name: Upload Test Report Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -63,18 +63,14 @@ jobs:
# and modify them (or add more) to build your code if your project
# uses a compiled language

- name: Setup .NET 5
- name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Setup .NET CORE
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
dotnet-version: 8.x.x
- name: Restore dependencies
run: dotnet restore OnixDataStandard.sln
- name: Build
run: dotnet build OnixDataStandard.sln --no-restore

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
9 changes: 2 additions & 7 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET 5
- name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Setup .NET CORE
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
dotnet-version: 8.x.x

- name: Restore dependencies
run: dotnet restore OnixDataStandard.sln
Expand Down
3 changes: 1 addition & 2 deletions OnixData.Standard.BaseTests/BaseOnixV3ParserTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.IO;
using OnixData.Version3;
using OnixData.Version3.Header;
using OnixData.Standard.Version3;
using Xunit;

namespace OnixData.Standard.BaseTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.IO;
using System.Linq;
using OnixData.Legacy;
using OnixData.Extensions;
using OnixData.Standard.Extensions;
using OnixData.Standard.Legacy;
using Xunit;

namespace OnixData.Standard.BaseTests.Legacy.CoreData
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.IO;
using OnixData.Legacy;
using OnixData.Standard.Legacy;
using Xunit;

namespace OnixData.Standard.BaseTests.Legacy.Text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
using System.IO;
using System.Linq;
using System.Text;
using OnixData.Extensions;
using OnixData.Version3;
using OnixData.Version3.Publishing;
using OnixData.Standard.Extensions;
using OnixData.Standard.Version3;
using OnixData.Standard.Version3.Price;
using OnixData.Standard.Version3.Publishing;
using Xunit;

namespace OnixData.Standard.BaseTests.Version3.CoreData
Expand Down Expand Up @@ -225,7 +226,7 @@ protected void ParseOnix3CoreDataSampleShortTags()
Assert.Equal(7.99m, tmpProduct.USDValidPrice.PriceAmountNum);

Assert.Equal(7.99m, tmpProduct.OnixProductSupplyList[0].OnixSupplyDetailList[0].OnixPriceList[0].PriceAmountNum);
Assert.Equal(OnixData.Version3.Price.OnixPrice.CONST_PRICE_TYPE_RRP_INCL, tmpProduct.OnixProductSupplyList[0].OnixSupplyDetailList[0].OnixPriceList[0].PriceType);
Assert.Equal(OnixPrice.CONST_PRICE_TYPE_RRP_INCL, tmpProduct.OnixProductSupplyList[0].OnixSupplyDetailList[0].OnixPriceList[0].PriceType);
Assert.Equal("GBP", tmpProduct.OnixProductSupplyList[0].OnixSupplyDetailList[0].OnixPriceList[0].CurrencyCode);

Assert.Equal("9780007324378", tmpProduct.RelatedMaterial.OnixRelatedProductList[0].EAN);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.IO;
using System.Linq;
using OnixData.Version3;
using OnixData.Version3.Header;
using OnixData.Standard.Version3;
using Xunit;

namespace OnixData.Standard.BaseTests.Version3.Text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

<PropertyGroup>
<LangVersion>default</LangVersion>
<OutputType>Exe</OutputType>
<TargetFrameworks>net462;net48;net5.0;netcoreapp3.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.0;net462;net48;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions OnixData.Standard.Benchmarks/OnixParsersBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
using OnixData.Legacy;
using OnixData.Version3;
using OnixData.Standard.Legacy;
using OnixData.Standard.Version3;

namespace OnixData.Standard.Benchmarks
{
Expand Down
9 changes: 0 additions & 9 deletions OnixData.Standard.CoreTests/Legacy/Text/OnixOtherTextTests.cs

This file was deleted.

33 changes: 0 additions & 33 deletions OnixData.Standard.CoreTests/OnixData.Standard.CoreTests.csproj

This file was deleted.

8 changes: 0 additions & 8 deletions OnixData.Standard.CoreTests/V3ParserTests.cs

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions OnixData.Standard.Net5Tests/Legacy/CoreData/OnixCoreTests.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OnixData.Standard.BaseTests.Legacy.CoreData;

namespace OnixData.Standard.CoreTests.Legacy.CoreData
namespace OnixData.Standard.Net8Tests.Legacy.CoreData
{
public class OnixCoreTests : BaseOnixCoreDataTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OnixData.Standard.BaseTests.Legacy.Text;

namespace OnixData.Standard.Net5Tests.Legacy.Text
namespace OnixData.Standard.Net8Tests.Legacy.Text
{
public class OnixOtherTextTests : BaseOnixOtherTextTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>

<LangVersion>default</LangVersion>

<AssemblyName>OnixData.Standard.Net8Tests</AssemblyName>

<RootNamespace>OnixData.Standard.Net8Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OnixData.Standard.BaseTests;

namespace OnixData.Standard.Net5Tests
namespace OnixData.Standard.Net8Tests
{
public class V3ParserTests : BaseOnixV3ParserTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OnixData.Standard.BaseTests.Version3.CoreData;

namespace OnixData.Standard.Net5Tests.Version3.CoreData
namespace OnixData.Standard.Net8Tests.Version3.CoreData
{
public class OnixCoreTests : BaseOnixCoreDataTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OnixData.Standard.BaseTests.Version3.Text;

namespace OnixData.Standard.Net5Tests.Version3.Text
namespace OnixData.Standard.Net8Tests.Version3.Text
{
public class OnixSupportingResourceTests : BaseOnixSupportingResourceTests
{
Expand Down
9 changes: 2 additions & 7 deletions OnixData.Standard/Extensions/OnixDataExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OnixData.Standard.Legacy;

using OnixData.Legacy;
using OnixData.Version3;

namespace OnixData.Extensions
namespace OnixData.Standard.Extensions
{
public static class OnixDataExtensions
{
Expand Down Expand Up @@ -204,7 +199,7 @@
{
long nEAN = Convert.ToInt64(TargetEAN);
}
catch (Exception ex)

Check warning on line 202 in OnixData.Standard/Extensions/OnixDataExtensions.cs

View workflow job for this annotation

GitHub Actions / Build and Test

The variable 'ex' is declared but never used

Check warning on line 202 in OnixData.Standard/Extensions/OnixDataExtensions.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The variable 'ex' is declared but never used
{ return false; }

if (TargetEAN.Length < CONST_EAN_LEN)
Expand Down Expand Up @@ -260,7 +255,7 @@
{
long nISBNPrefix = Convert.ToInt64(ISBNPrefix);
}
catch (Exception ex) { return false; }

Check warning on line 258 in OnixData.Standard/Extensions/OnixDataExtensions.cs

View workflow job for this annotation

GitHub Actions / Build and Test

The variable 'ex' is declared but never used

Check warning on line 258 in OnixData.Standard/Extensions/OnixDataExtensions.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The variable 'ex' is declared but never used

try
{
Expand Down Expand Up @@ -298,7 +293,7 @@
else
IsValid = false;
}
catch(Exception ex)

Check warning on line 296 in OnixData.Standard/Extensions/OnixDataExtensions.cs

View workflow job for this annotation

GitHub Actions / Build and Test

The variable 'ex' is declared but never used

Check warning on line 296 in OnixData.Standard/Extensions/OnixDataExtensions.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The variable 'ex' is declared but never used
{
IsValid = false;
}
Expand Down
17 changes: 7 additions & 10 deletions OnixData.Standard/Extensions/OnixParserExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using OnixData.Standard.Legacy;
using OnixData.Standard.Version3;
using OnixData.Standard.Version3.Header;
using OnixData.Standard.Version3.Price;
using OnixData.Standard.Version3.Supply;

using OnixData.Legacy;
using OnixData.Version3;
using OnixData.Version3.Header;
using OnixData.Version3.Price;
using OnixData.Version3.Supply;

namespace OnixData.Extensions
namespace OnixData.Standard.Extensions
{
public static class OnixParserExtensions
{
Expand Down Expand Up @@ -68,7 +65,7 @@
int nDefPriceTypeCd = -1;

try { nDefPriceTypeCd = Convert.ToInt32(poOnixHeader.DefaultPriceTypeCode); }
catch (Exception ex) { }

Check warning on line 68 in OnixData.Standard/Extensions/OnixParserExtensions.cs

View workflow job for this annotation

GitHub Actions / Build and Test

The variable 'ex' is declared but never used

Check warning on line 68 in OnixData.Standard/Extensions/OnixParserExtensions.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The variable 'ex' is declared but never used

if (nDefPriceTypeCd > 0)
TmpPrice.PriceTypeCode = nDefPriceTypeCd;
Expand Down Expand Up @@ -268,7 +265,7 @@
else if (m.Value.StartsWith("&"))
sResult = m.Value;
}
catch (Exception ex)

Check warning on line 268 in OnixData.Standard/Extensions/OnixParserExtensions.cs

View workflow job for this annotation

GitHub Actions / Build and Test

The variable 'ex' is declared but never used

Check warning on line 268 in OnixData.Standard/Extensions/OnixParserExtensions.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The variable 'ex' is declared but never used
{
sResult = m.Value;
}
Expand Down
17 changes: 2 additions & 15 deletions OnixData.Standard/Extensions/OnixReplaceExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Text;

using OnixData.Legacy;
using OnixData.Version3;
using OnixData.Version3.Header;
using OnixData.Version3.Price;
using OnixData.Version3.Supply;

namespace OnixData.Extensions
namespace OnixData.Standard.Extensions
{
public static class OnixReplaceExtensions
{
Expand Down
5 changes: 1 addition & 4 deletions OnixData.Standard/Extensions/OnixXmlExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;

using OnixData;

namespace OnixData.Extensions
namespace OnixData.Standard.Extensions
{
public static class OnixXmlExtensions
{
Expand Down Expand Up @@ -110,7 +107,7 @@
break;
}
}
catch (Exception ex)

Check warning on line 110 in OnixData.Standard/Extensions/OnixXmlExtensions.cs

View workflow job for this annotation

GitHub Actions / Build and Test

The variable 'ex' is declared but never used

Check warning on line 110 in OnixData.Standard/Extensions/OnixXmlExtensions.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The variable 'ex' is declared but never used
{
sValue = String.Empty;
}
Expand Down Expand Up @@ -158,7 +155,7 @@
}
}
}
catch (Exception ex)

Check warning on line 158 in OnixData.Standard/Extensions/OnixXmlExtensions.cs

View workflow job for this annotation

GitHub Actions / Build and Test

The variable 'ex' is declared but never used

Check warning on line 158 in OnixData.Standard/Extensions/OnixXmlExtensions.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The variable 'ex' is declared but never used
{
bIsValidXml = false;
}
Expand Down
6 changes: 1 addition & 5 deletions OnixData.Standard/Legacy/OnixLegacyAudRange.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OnixData.Legacy
namespace OnixData.Standard.Legacy
{
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
Expand Down
Loading
Loading