Class FakeDateTimeZoneSource
A time zone source for test purposes.
Create instances via FakeDateTimeZoneSource.Builder.
Since 1.1.x
Availability net45, netstandard1.3
Inheritance
Object
FakeDateTimeZoneSource
Implements
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: NodaTime.Testing.TimeZones
Assembly: NodaTime.Testing.dll
Syntax
public sealed class FakeDateTimeZoneSource : IDateTimeZoneSource
Remarks
Under the PCL, the mapping from TimeZoneInfo is performed
using the StandardName property instead of the Id property, as the Id
property isn't available. The standard name is almost always the same
anyway, known exceptions including Jerusalem and the Malay Peninsula.
Properties
VersionId
Since 1.1.x
Availability net45, netstandard1.3
Declaration
public string VersionId { get; }
Property Value
Type | Description |
---|---|
String |
Methods
ForId(String)
Since 1.1.x
Availability net45, netstandard1.3
Declaration
public DateTimeZone ForId(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id |
Returns
Type | Description |
---|---|
DateTimeZone |
GetIds()
Since 1.1.x
Availability net45, netstandard1.3
Declaration
public IEnumerable<string> GetIds()
Returns
Type | Description |
---|---|
IEnumerable<String> |
GetSystemDefaultId()
Returns this source's ID for the system default time zone.
Since 2.0.x
Availability net45, netstandard1.3
Declaration
public string GetSystemDefaultId()
Returns
Type | Description |
---|---|
String | The ID for the system default time zone for this source, or null if the system default time zone has no mapping in this source. |
ToProvider()
Creates a time zone provider (DateTimeZoneCache) from this source.
Since 1.1.x
Availability net45, netstandard1.3
Declaration
public IDateTimeZoneProvider ToProvider()
Returns
Type | Description |
---|---|
IDateTimeZoneProvider | A provider backed by this source. |