Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move TimeZone instance property of AtataContext to AtataContext.GlobalProperties #823

Closed
YevgeniyShunevych opened this issue Feb 17, 2024 · 0 comments
Assignees
Milestone

Comments

@YevgeniyShunevych
Copy link
Member

Having a TimeZone as an instance property of AtataContext is wrong, as time zone should be the same for all the contexts, thus it should not be configured within regular AtataContext configuration, which can be different for tests.
Such global properties starting v3 are now located in AtataContext.GlobalProperties.

AtataContext.GlobalProperties time zone related members:

/// <summary>
/// Gets or sets the time zone.
/// The default value is <see cref="TimeZoneInfo.Local"/>.
/// </summary>
public TimeZoneInfo TimeZone { get; set; }

/// <summary>
/// Sets the UTC time zone.
/// </summary>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseUtcTimeZone();

/// <summary>
/// Sets the time zone by identifier, which corresponds to the <see cref="TimeZoneInfo.Id"/> property.
/// </summary>
/// <param name="timeZoneId">The time zone identifier.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseTimeZone(string timeZoneId);

/// <summary>
/// Sets the time zone.
/// </summary>
/// <param name="timeZone">The time zone.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseTimeZone(TimeZoneInfo timeZone);

Old AtataContextBuilder time zone configurational methods are marked as obsolete.

@YevgeniyShunevych YevgeniyShunevych added this to the 3.0.0 milestone Feb 17, 2024
@YevgeniyShunevych YevgeniyShunevych self-assigned this Feb 17, 2024
YevgeniyShunevych added a commit that referenced this issue Feb 17, 2024
- #823 Move `TimeZone` instance property of `AtataContext` to `AtataContext.GlobalProperties`.
- #824 Move `BuildStart` and `BuildStartUtc` static properties of `AtataContext` to `AtataContext.GlobalProperties`.
- #825 Move `ModeOfCurrent` static property of `AtataContext` to `AtataContext.GlobalProperties`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant