Skip to content
Open
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
75 changes: 0 additions & 75 deletions DesktopClock.Tests/DateTimeTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Globalization;
using System.Linq;

namespace DesktopClock.Tests;

Expand Down Expand Up @@ -143,77 +141,4 @@ public void IsOnInterval_CountdownReached_ShouldReturnTrue()
Assert.True(result);
}

[Theory]
[InlineData("dddd, MMMM dd", "Monday, January 01")]
[InlineData("yyyy-MM-dd", "2024-01-01")]
[InlineData("HH:mm:ss", "00:00:00")]
[InlineData("MMMM dd, yyyy", "January 01, 2024")]
public void FromFormat_CreatesCorrectExample(string format, string expected)
{
// Arrange
var dateTimeOffset = new DateTime(2024, 01, 01);

// Act
var dateFormatExample = DateFormatExample.FromFormat(format, dateTimeOffset, CultureInfo.InvariantCulture);

// Assert
Assert.Equal(format, dateFormatExample.Format);
Assert.Equal(expected, dateFormatExample.Example);
}

[Fact]
public void FromFormat_WithTokenizedFormat_ShouldWork()
{
// Arrange
var dateTimeOffset = new DateTimeOffset(2024, 3, 15, 14, 30, 0, TimeSpan.Zero);
var format = "{ddd}, {MMM dd}, {HH:mm}";

// Act
var dateFormatExample = DateFormatExample.FromFormat(format, dateTimeOffset, CultureInfo.InvariantCulture);

// Assert
Assert.Equal(format, dateFormatExample.Format);
Assert.Equal("Fri, Mar 15, 14:30", dateFormatExample.Example);
}

[Fact]
public void DefaultExamples_ShouldNotBeEmpty()
{
// Assert
Assert.NotEmpty(DateFormatExample.DefaultExamples);
}

[Fact]
public void DefaultExamples_AllShouldHaveFormatAndExample()
{
// Assert
foreach (var example in DateFormatExample.DefaultExamples)
{
Assert.NotNull(example.Format);
Assert.NotEmpty(example.Format);
Assert.NotNull(example.Example);
Assert.NotEmpty(example.Example);
}
}

[Fact]
public void DefaultExamples_ShouldContainCustomFormats()
{
// Assert - check for some expected custom formats
var formats = DateFormatExample.DefaultExamples.Select(e => e.Format).ToList();

Assert.Contains(formats, f => f.Contains("{ddd}"));
Assert.Contains(formats, f => f.Contains("{HH:mm}") || f.Contains("{h:mm tt}"));
}

[Fact]
public void DefaultExamples_ShouldContainStandardFormats()
{
// Assert - check for some expected standard formats
var formats = DateFormatExample.DefaultExamples.Select(e => e.Format).ToList();

Assert.Contains("D", formats); // Long date pattern
Assert.Contains("T", formats); // Long time pattern
Assert.Contains("t", formats); // Short time pattern
}
}
79 changes: 0 additions & 79 deletions DesktopClock/Data/DateFormatExample.cs

This file was deleted.

14 changes: 7 additions & 7 deletions DesktopClock/Properties/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,25 +348,25 @@ private Settings()
/// Persisted width of the settings window.
/// </summary>
/// <remarks>
/// This remembers how wide you last made the settings window so it feels familiar the next time you open it.
/// This helps the settings experience reopen at a comfortable size instead of snapping back to a fixed default.
/// </remarks>
public double SettingsWindowWidth { get; set; } = 720;
public double SettingsWindowWidth { get; set; } = 1120;

/// <summary>
/// Persisted height of the settings window.
/// </summary>
/// <remarks>
/// This remembers how tall you last made the settings window so you do not have to resize it every time.
/// This helps the settings experience reopen at a comfortable size instead of snapping back to a fixed default.
/// </remarks>
public double SettingsWindowHeight { get; set; } = 600;
public double SettingsWindowHeight { get; set; } = 860;

/// <summary>
/// Persisted vertical scroll offset of the settings window.
/// Persisted vertical scroll position of the settings window.
/// </summary>
/// <remarks>
/// This helps reopen the settings window near the same section you were working in before.
/// This lets the scrollable settings experience reopen near the last section the user was editing.
/// </remarks>
public double SettingsScrollPosition { get; set; } = 0;
public double SettingsScrollPosition { get; set; }

/// <summary>
/// Bit flags describing which one-time teaching tips have already been shown.
Expand Down
Loading
Loading