Skip to content

Commit d6e39d3

Browse files
author
TheTribe
committed
Merge pull request #107 from jbatte47/master
3.10-beta.2 release
2 parents aa09826 + 17a30c8 commit d6e39d3

File tree

8 files changed

+61
-13
lines changed

8 files changed

+61
-13
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The following log details the outward-facing changes made to code-patterns since its first migration to GitHub.
44

5+
## 3.10-beta.2 ##
6+
7+
- Changes made to `Patterns.Runtime.IDateTimeInfo` and `Patterns.Runtime.DefaultDateTimeInfo` ([issue 105](https://github.com/TheTribe/code-patterns/issues/105)):
8+
- Added `DateTime GetUtcNow()` to `IDateTimeInfo`
9+
- Updated implementation of `DefaultDateTimeInfo`
10+
511
## 3.10-beta.1 ##
612

713
- Additions / changes made to `Patterns.Logging` and `Patterns.Interception` ([issue 96](https://github.com/TheTribe/code-patterns/issues/96)):

src/Patterns/Runtime/DefaultDateTimeInfo.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ public DateTime GetNow()
4343
return DateTime.Now;
4444
}
4545

46+
/// <summary>
47+
/// Gets the Coordinated Universal Time (UTC) <see cref="DateTime" /> value representing "now".
48+
/// </summary>
49+
/// <returns></returns>
50+
public DateTime GetUtcNow()
51+
{
52+
return DateTime.UtcNow;
53+
}
54+
4655
#endregion
4756
}
4857
}

src/Patterns/Runtime/IDateTimeInfo.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,11 @@ public interface IDateTimeInfo
3636
/// Gets the <see cref="DateTime" /> value representing "now".
3737
/// </summary>
3838
DateTime GetNow();
39+
40+
/// <summary>
41+
/// Gets the Coordinated Universal Time (UTC) <see cref="DateTime"/> value representing "now".
42+
/// </summary>
43+
/// <returns></returns>
44+
DateTime GetUtcNow();
3945
}
4046
}

src/Patterns/SolutionAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
[assembly: ComVisible(false)]
3333
[assembly: NeutralResourcesLanguage("en-US")]
3434
[assembly: AssemblyVersion("3.10.0")]
35-
[assembly: AssemblyInformationalVersion("3.10.0-beta1")]
35+
[assembly: AssemblyInformationalVersion("3.10.0-beta2")]

src/Patterns/SolutionAssemblyInfo.settings.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Settings.Initialize(
33
majorNumber: 3,
44
minorNumber: 10,
55
patchNumber: 0,
6-
buildNumber: 1,
6+
buildNumber: 2,
77
buildLevel: BuildLevels.Beta
88
);
99
#><#+

src/_specs/Features/Runtime/DateTimeInfo.feature

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ Feature: Date Time Info
33
DateTime class and its Now property, and I want the default implementation
44
to provide equivalent information when compared to DateTime.
55

6-
@dateTimeInfo
76
Scenario: Now vs GetNow
87
Given I have a default DateTime abstraction
98
When I store the results of both the DateTime.Now property and the IDateTimeInfo.GetNow method
9+
Then the results of both "now" DateTime values should be equal
10+
11+
Scenario: UtcNow vs GetUtcNow
12+
Given I have a default DateTime abstraction
13+
When I store the results of both the DateTime.UtcNow property and the IDateTimeInfo.GetUtcNow method
1014
Then the results of both "now" DateTime values should be equal

src/_specs/Features/Runtime/DateTimeInfo.feature.cs

Lines changed: 24 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/_specs/Steps/Runtime/DateTimeInfoSteps.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ namespace Patterns.Specifications.Steps.Runtime
4040
[Binding]
4141
public class DateTimeInfoSteps
4242
{
43-
private readonly DateTimeInfoContext _context;
4443
private readonly AutofacContext _autofac;
44+
private readonly DateTimeInfoContext _context;
4545

4646
public DateTimeInfoSteps(DateTimeInfoContext context, AutofacContext autofac)
4747
{
@@ -68,11 +68,18 @@ public void StoreBothDateTimeResults()
6868
_context.SystemNow = DateTime.Now;
6969
}
7070

71+
[When(@"I store the results of both the DateTime\.UtcNow property and the IDateTimeInfo\.GetUtcNow method")]
72+
public void StoreBothUtcDateTimeResults()
73+
{
74+
_context.CustomNow = _context.DateTimeInfo.GetUtcNow();
75+
_context.SystemNow = DateTime.UtcNow;
76+
}
77+
7178
[Then(@"the resolved IDateTimeInfo object should be an instance of DefaultDateTimeInfo")]
7279
public void AssertResolvedIDateTimeInfoIsDefault()
7380
{
7481
_context.DateTimeInfo.Should().NotBeNull();
75-
_context.DateTimeInfo.GetType().Should().Be(typeof(DefaultDateTimeInfo));
82+
_context.DateTimeInfo.GetType().Should().Be(typeof (DefaultDateTimeInfo));
7683
}
7784

7885
[Then(@"the results of both ""now"" DateTime values should be equal")]

0 commit comments

Comments
 (0)