Skip to content
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
6 changes: 4 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ jobs:
3.1.x
6.0.x
8.0.x
10.0.x
- name: Build library (.net core)
run: dotnet build src/OpenProtocolInterpreter/OpenProtocolInterpreter.csproj --configuration release
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Build and run .net core tests
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: |
3.1.x
6.0.x
8.0.x
- name: Test Mids
10.0.x
- name: Build and run .net core tests
run: |
dotnet build src/MIDTesters.Core/MIDTesters.Core.csproj
dotnet test src/MIDTesters.Core/MIDTesters.Core.csproj
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@ jobs:
3.1.x
6.0.x
8.0.x
10.0.x
- name: Build library (.net core)
run: dotnet build src/OpenProtocolInterpreter/OpenProtocolInterpreter.csproj --configuration release
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Build and run .net core tests
- name: Setup .NET Core
uses: actions/setup-dotnet@master
with:
dotnet-version: |
3.1.x
6.0.x
8.0.x
- name: Test Mids
10.0.x
- name: Build and run .net core tests
run: |
dotnet build src/MIDTesters.Core/MIDTesters.Core.csproj
dotnet test src/MIDTesters.Core/MIDTesters.Core.csproj
Expand All @@ -46,4 +48,4 @@ jobs:
- name: Publish NuGet
run: |
dotnet build src/OpenProtocolInterpreter/OpenProtocolInterpreter.csproj --configuration release
nuget push src/OpenProtocolInterpreter/bin/release/OpenProtocolInterpreter.6.1.0.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate
nuget push src/OpenProtocolInterpreter/bin/release/OpenProtocolInterpreter.6.1.1.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dotnet.defaultSolution": "OpenProtocolInterpreter.sln",
"omnisharp.useModernNet": true,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableDecompilationSupport": true,
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true
}
15 changes: 15 additions & 0 deletions omnisharp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"msbuild": {
"enabled": true,
"useBundledOnly": false,
"loadProjectsOnDemand": false
},
"RoslynExtensionsOptions": {
"enableAnalyzersSupport": true,
"enableImportCompletion": true,
"enableDecompilationSupport": true
},
"FormattingOptions": {
"enableEditorConfigSupport": true
}
}
27 changes: 27 additions & 0 deletions src/MIDTesters.Core/Converters/DecimalConverterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,33 @@ public void ZeroPaddedStringToDecimal()
Assert.AreEqual(3.3123m, result);
}

[TestMethod]
[TestCategory("Decimal")]
public void DecimalWithExponentToDecimal()
{
var value = "1.23E+02";
var result = OpenProtocolConvert.ToDecimal(value);
Assert.AreEqual(123m, result);
}

[TestMethod]
[TestCategory("Decimal")]
public void DecimalWithNegativeExponentToDecimal()
{
var value = "1.5E-03";
var result = OpenProtocolConvert.ToDecimal(value);
Assert.AreEqual(0.0015m, result);
}

[TestMethod]
[TestCategory("Decimal")]
public void DecimalWithLowercaseExponentToDecimal()
{
var value = "2.5e+01";
var result = OpenProtocolConvert.ToDecimal(value);
Assert.AreEqual(25m, result);
}

[TestMethod]
[TestCategory("Decimal")]
public void ConcurrencyTest()
Expand Down
2 changes: 1 addition & 1 deletion src/MIDTesters.Core/MIDTesters.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/OpenProtocolInterpreter/OpenProtocolConvert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static decimal ToDecimal(string value)
{
decimal decimalValue = 0;
if (!string.IsNullOrWhiteSpace(value))
decimal.TryParse(value.Replace(',', '.'), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, _formatProvider, out decimalValue);
decimal.TryParse(value.Replace(',', '.'), NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowExponent, _formatProvider, out decimalValue);

return decimalValue;
}
Expand Down
6 changes: 3 additions & 3 deletions src/OpenProtocolInterpreter/OpenProtocolInterpreter.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6;net8</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Version>6.1.0</Version>
<Version>6.1.1</Version>
<Description>Converts the ugly package that came from Open Protocol to an object</Description>
<Copyright>Copyright © 2023</Copyright>
<Copyright>Copyright © 2026</Copyright>
<Authors>Henrique Dal Bello Batista</Authors>
<Company>Henrique Dal Bello Batista</Company>
<PackageProjectUrl>https://github.com/Rickedb/OpenProtocolInterpreter</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected void FilterSelectedMids(IEnumerable<Type> mids)
/// <param name="mids">Ignored mid instances</param>
private void FilterSelectedMids(IEnumerable<MidCompiledInstance> mids)
{
var ignoredMids = _templates.Where(x => !mids.Contains(x.Value));
var ignoredMids = _templates.Where(x => !mids.Contains(x.Value)).ToList();
foreach (var ignore in ignoredMids)
_templates.Remove(ignore);
}
Expand Down
120 changes: 0 additions & 120 deletions src/OpenProtocolInterpreter/vin/Mid0052.cs

This file was deleted.

Loading