Skip to content

Commit

Permalink
Bump version to v5.12.3 (#47)
Browse files Browse the repository at this point in the history
Update SmartFormat package to v3.5.0
  • Loading branch information
axunonb authored Jul 30, 2024
1 parent e7f1183 commit 7424bf2
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<Copyright>Copyright 2011-$(CurrentYear) axuno, MailMergeLib Project maintainers and contributers</Copyright>
<RepositoryUrl>https://github.com/axuno/MailMergeLib.git</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<Version>5.12.2</Version>
<FileVersion>5.12.2</FileVersion>
<Version>5.12.3</Version>
<FileVersion>5.12.3</FileVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion> <!--only update AssemblyVersion with major releases -->
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
Expand Down
4 changes: 2 additions & 2 deletions Src/MailMergeLib.Tests/MailMergeLib.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="netDumbster" Version="3.1.0" />
<PackageReference Include="netDumbster" Version="3.1.1" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

Expand Down
22 changes: 16 additions & 6 deletions Src/MailMergeLib.Tests/Message_SmartFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ private class TestClass2
}

[Test]
public void PlaceholderCaseSensitivityTest()
public void PlaceholderCaseSensitiveTest()
{
var dataItem = new
{
Email = "test@example.com",
};

var mmm = new MailMergeMessage();
using var mmm = new MailMergeMessage();
mmm.Config.SmartFormatterConfig.CaseSensitivity = CaseSensitivityType.CaseSensitive;
mmm.Config.SmartFormatterConfig.FormatErrorAction = ErrorAction.OutputErrorInResult;
mmm.Config.SmartFormatterConfig.ParseErrorAction = ErrorAction.OutputErrorInResult;
Expand All @@ -52,14 +52,24 @@ public void PlaceholderCaseSensitivityTest()
Assert.That(mmm.SmartFormatter.Format("{Email}", dataItem), Is.EqualTo(dataItem.Email));
Assert.That(mmm.SmartFormatter.Format("{EmAiL}", dataItem), Is.Not.EqualTo(dataItem.Email));
});
// Changing the the SmartFormatterConfig settings creates a new instance of
// the SmartFormatter inside MailMergeMessage
}

[Test]
public void PlaceholderCaseInsensitiveTest()
{
var dataItem = new {
Email = "test@example.com",
};

using var mmm = new MailMergeMessage();
mmm.Config.SmartFormatterConfig.CaseSensitivity = CaseSensitivityType.CaseInsensitive;
var actual = mmm.SmartFormatter.Format("{EmAiL}", dataItem);
mmm.Config.SmartFormatterConfig.FormatErrorAction = ErrorAction.OutputErrorInResult;
mmm.Config.SmartFormatterConfig.ParseErrorAction = ErrorAction.OutputErrorInResult;

var actual = mmm.SmartFormatter.Format("{EMAIl}", dataItem);
Assert.That(actual, Is.EqualTo(dataItem.Email));
}


[Test]
public void DataTypeTests()
{
Expand Down
2 changes: 1 addition & 1 deletion Src/MailMergeLib/MailMergeLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ https://github.com/axuno/MailMergeLib/releases</PackageReleaseNotes>
<PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="MailKit" Version="4.7.1.1" />
<PackageReference Include="MimeKit" Version="4.7.1" />
<PackageReference Include="SmartFormat.NET" Version="3.4.0" />
<PackageReference Include="SmartFormat.NET" Version="3.5.0" />
<PackageReference Include="YAXLib" Version="4.3.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
1 change: 0 additions & 1 deletion Src/MailMergeLib/MailSmartFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ private MailSmartFormatter(SmartSettings? currentSmartSettings) : base(currentSm
new NullFormatter(),
new ChooseFormatter(),
new SubStringFormatter(),
// The DefaultSource reproduces the string.Format behavior:
new DefaultFormatter())

// Extensions to keep API compatibility with MailMergeLib v5.x
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 5.12.2.{build} # Only change for mayor versions (e.g. 6.0.0)
version: 5.0.0.{build} # Only change for mayor versions (e.g. 6.0.0)
environment:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
matrix:
Expand Down Expand Up @@ -27,7 +27,7 @@ for:
- ps: dotnet restore --verbosity quiet
- ps: dotnet add .\MailMergeLib.Tests\MailMergeLib.Tests.csproj package AltCover
- ps: |
$version = "5.12.2"
$version = "5.12.3"
$versionFile = $version + "." + ${env:APPVEYOR_BUILD_NUMBER}
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
Expand Down

0 comments on commit 7424bf2

Please sign in to comment.