Skip to content

Commit

Permalink
Namespace and code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mikernet committed Mar 7, 2024
1 parent 8bc44f8 commit 0fe1df3
Show file tree
Hide file tree
Showing 37 changed files with 38 additions and 147 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Immutable;
using System.Runtime.CompilerServices;
using System.Text;
Expand Down Expand Up @@ -416,7 +416,7 @@ public ImmutableSortedMoneySet SubtractRange(IEnumerable<Money> values)
/// Returns a string representation of the money values this set contains.
/// </summary>
/// <param name="format">The format to use for each money value. See <see cref="Money.ToString(string?, IFormatProvider?)"/> for valid money formats.
/// Prepend the format with the <c>"!"</c> character to ignore zero amount values.</param>
/// Prepend the desired money format with the <c>!</c> character to ignore zero amount values.</param>
/// <param name="formatProvider">The format provider that will be used to obtain number format information. This should be a <see cref="CultureInfo"/>
/// instance for formats that depend on the culture, otherwise the current culture is used.</param>
public string ToString(string? format, IFormatProvider? formatProvider = null)
Expand Down
3 changes: 1 addition & 2 deletions Source/Singulink.Globalization.Currency/SortedMoneySet.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections;
using System.Collections.Immutable;
using System.Text;

namespace Singulink.Globalization;
Expand Down Expand Up @@ -347,7 +346,7 @@ public void SubtractRange(IEnumerable<Money> values)
/// Returns a string representation of the money values this set contains.
/// </summary>
/// <param name="format">The format to use for each money value. See <see cref="Money.ToString(string?, IFormatProvider?)"/> for valid money formats.
/// Prepend the format with the <c>"!"</c> character to ignore zero amount values.</param>
/// Prepend the desired money format with the <c>!</c> character to ignore zero amount values.</param>
/// <param name="formatProvider">The format provider that will be used to obtain number format information. This should be a <see cref="CultureInfo"/>
/// instance for formats that depend on the culture, otherwise the current culture is used.</param>
public string ToString(string? format, IFormatProvider? formatProvider = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Globalization;

namespace Singulink.Globalization.Utilities;
namespace Singulink.Globalization.Utilities;

internal static class CultureInfoExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Singulink.Globalization.Utilities;
namespace Singulink.Globalization.Utilities;

internal static class DecimalExtensions
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class Add
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class AddRange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class Remove
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class RemoveAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class RoundToCurrencyDigits
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class SetAmount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class SetValue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class Subtract
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class SubtractRange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System.Collections.Generic;
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class TransformAmounts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class TrimZeroAmounts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class TryGetAmount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;
namespace Singulink.Globalization.Tests.ImmutableSortedMoneySetTests;

[PrefixTestClass]
public class TryGetValue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.MoneyTests;
namespace Singulink.Globalization.Tests.MoneyTests;

[PrefixTestClass]
public class CompareTo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.MoneyTests;
namespace Singulink.Globalization.Tests.MoneyTests;

#pragma warning disable CS1718 // Comparison made to same variable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.MoneyTests;
namespace Singulink.Globalization.Tests.MoneyTests;

[PrefixTestClass]
public class RoundToCurrencyDigits
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Globalization;
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.MoneyTests;

Expand All @@ -11,7 +9,7 @@ public class ToString

private static readonly CultureInfo EnUS = CultureInfo.GetCultureInfo("en-US");
private static readonly CultureInfo FrFR = CultureInfo.GetCultureInfo("fe-FR");
private static readonly CultureInfo KeaCV = CultureInfo.GetCultureInfo("kea-CV"); // currency symbol $ as decimal separator
private static readonly CultureInfo KeaCV = CultureInfo.GetCultureInfo("kea-CV"); // $ as decimal separator, no actual currency symbol

[TestMethod]
public void DefaultFormat()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class Add
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class AddRange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class Remove
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class RoundToCurrencyDigits
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class SetAmount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class SetValue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class Subtract
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class SubtractRange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class TransformAmounts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class TransformValues
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class TrimZeroAmounts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class TryGetAmount
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using PrefixClassName.MsTest;
using Shouldly;

namespace Singulink.Globalization.Tests.SortedMoneySetTests;
namespace Singulink.Globalization.Tests.SortedMoneySetTests;

[PrefixTestClass]
public class TryGetValue
Expand Down
4 changes: 3 additions & 1 deletion Tests/Singulink.Globalization.Currency.Tests/Usings.cs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
global using Microsoft.VisualStudio.TestTools.UnitTesting;
global using Microsoft.VisualStudio.TestTools.UnitTesting;
global using PrefixClassName.MsTest;
global using Shouldly;

0 comments on commit 0fe1df3

Please sign in to comment.