Skip to content

Commit

Permalink
chore: Remove unintentional duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 authored Jan 6, 2025
1 parent 368179d commit 1ee63cd
Showing 1 changed file with 1 addition and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Globalization;
using System.Globalization;
using System.Linq;
using Windows.Globalization.DateTimeFormatting;
using FluentAssertions;
Expand Down Expand Up @@ -26,33 +26,6 @@ public void When_UsingVariousLanguages(string format, string language, string ex
firstPattern.Should().Be(expectedPattern);
}

[TestMethod]
public void When_FormattingDateVariants_ShouldProduceExpectedFormats()
{
var expectedResults = new Dictionary<string, string>
{
{ "{day.integer}/{month.integer}/{year.full}", "27/6/2024" },
{ "{month.full} {year.full}", "June 2024" },
{ "{month.full} {day.integer}", "June 27" },
{ "{dayofweek.abbreviated}, {day.integer} {month.abbreviated} {year.full}", "Thu, 27 Jun 2024" },
{ "{year.full}-{month.integer}-{day.integer}", "2024-6-27" },
{ "{day.integer}/{month.integer}/{year.abbreviated}", "27/6/24" },
{ "{day.integer} {month.abbreviated} {year.full}", "27 Jun 2024" },
{ "{month.full} {day.integer}, {year.full}", "June 27, 2024" },
{ "{month.abbreviated} {day.integer}, {year.full}", "Jun 27, 2024" },
{ "{dayofweek.full}, {day.integer} {month.full} {year.full}", "Thursday, 27 June 2024" },
{ "{dayofweek.abbreviated}, {day.integer} {month.abbreviated} {year.abbreviated}", "Thu, 27 Jun 24" }
};
foreach (var kvp in expectedResults)
{
var template = kvp.Key;
var expected = kvp.Value;
var formatter = new DateTimeFormatter(template);
var formattedDate = formatter.Format(new(2024, 6, 27, 14, 30, 0, TimeSpan.Zero));
Assert.AreEqual(expected, formattedDate, $"Mismatch for template: {template}");
}
}

#if !NET7_0_OR_GREATER // https://github.com/unoplatform/uno/issues/9080
[TestMethod]
[DataRow("day", "en-US|fr-CA|ru-RU", "{day.integer}|{day.integer}|{day.integer}")]
Expand Down

0 comments on commit 1ee63cd

Please sign in to comment.