-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6201 from bdukes/fix-server-info-version
Fix server info error on .NET 4.8
- Loading branch information
Showing
6 changed files
with
81 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
DNN Platform/Tests/DotNetNuke.Tests.Core/Common/GlobalsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
|
||
namespace DotNetNuke.Tests.Core.Common; | ||
|
||
using System; | ||
|
||
using DotNetNuke.Common; | ||
|
||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
public class GlobalsTests | ||
{ | ||
[Test] | ||
public void FormatVersion_WhenTwoDigitVersionFormattedWithThreeParts_UsesZeroForThirdPart() | ||
{ | ||
Assert.That(Globals.FormatVersion(new Version("4.8"), "0", 3, "."), Is.EqualTo("4.8.0")); | ||
} | ||
|
||
[Test] | ||
public void FormatVersion_WhenThreeDigitVersionFormattedWithThreeParts_DisplaysThirdPart() | ||
{ | ||
Assert.That(Globals.FormatVersion(new Version("4.8.1"), "0", 3, "."), Is.EqualTo("4.8.1")); | ||
} | ||
|
||
[Test] | ||
public void FormatVersion_WhenFourDigitVersionFormattedWithThreeParts_DoesNotDisplayFourthPart() | ||
{ | ||
Assert.That(Globals.FormatVersion(new Version("4.8.1.7"), "0", 3, "."), Is.EqualTo("4.8.1")); | ||
} | ||
|
||
[Test] | ||
public void FormatVersion_WhenTwoDigitVersion_DisplaysThreePartsWithLeadingZeroes_InABrokenWay() | ||
{ | ||
Assert.That(Globals.FormatVersion(new Version("4.8")), Is.EqualTo("04.08.-01")); | ||
} | ||
|
||
[Test] | ||
public void FormatVersion_WhenThreeDigitVersion_DisplaysThirdPartWithLeadingZeroes() | ||
{ | ||
Assert.That(Globals.FormatVersion(new Version("4.8.1")), Is.EqualTo("04.08.01")); | ||
} | ||
|
||
[Test] | ||
public void FormatVersion_WhenFourDigitVersion_DisplaysThreePartsWithLeadingZeroes() | ||
{ | ||
Assert.That(Globals.FormatVersion(new Version("4.8.1.7")), Is.EqualTo("04.08.01")); | ||
} | ||
|
||
[Test] | ||
public void FormatVersion_WhenFourDigitVersionWithRevision_DisplaysThreePartsWithLeadingZeroes() | ||
{ | ||
Assert.That(Globals.FormatVersion(new Version("4.8.1.7"), true), Is.EqualTo("04.08.01 (7)")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters