Skip to content

Commit

Permalink
Fixed tests, and made sure that tests actually run in verification pi…
Browse files Browse the repository at this point in the history
…peline. (#17)

* Fixed tests, and made sure that tests actually run in verification pipeline.

* Fixed a test.
  • Loading branch information
Timovzl authored Mar 23, 2023
1 parent 80e3888 commit 2917733
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions DomainModeling.Tests/DummyBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ public class DummyBuilderTests
[Fact]
public void Build_Regularly_ShouldReturnExpectedResult()
{
var expectedCreationDateTime = new DateTime(2000, 01, 01, 00, 00, 00, DateTimeKind.Utc).ToLocalTime();

var result = new TestEntityDummyBuilder().Build();

Assert.Equal(new DateTime(2000, 01, 01, 01, 00, 00, DateTimeKind.Local), result.CreationDateTime);
Assert.Equal(expectedCreationDateTime, result.CreationDateTime);
Assert.Equal(DateTimeKind.Local, result.CreationDateTime.Kind);
Assert.Equal(1, result.Count);
Assert.Equal("Currency", result.Amount.Currency);
Assert.Equal(1m, result.Amount.Amount.Value);
Expand All @@ -19,6 +22,8 @@ public void Build_Regularly_ShouldReturnExpectedResult()
[Fact]
public void Build_WithCustomizations_ShouldReturnExpectedResult()
{
var expectedCreationDateTime = new DateTime(3000, 01, 01, 00, 00, 00, DateTimeKind.Utc).ToLocalTime();

var result = new TestEntityDummyBuilder()
.WithCreationDateTime(DateTime.UnixEpoch)
.WithCreationDateTime("3000-01-01") // DateTimes get a numeric overload
Expand All @@ -32,7 +37,7 @@ public void Build_WithCustomizations_ShouldReturnExpectedResult()
.WithNotAProperty("Whatever")
.Build();

Assert.Equal(new DateTime(3000, 01, 01, 01, 00, 00, DateTimeKind.Local), result.CreationDateTime);
Assert.Equal(expectedCreationDateTime, result.CreationDateTime);
Assert.Equal(DateTimeKind.Local, result.CreationDateTime.Kind);
Assert.Equal(new DateOnly(1970, 01, 01), result.CreationDate);
Assert.Equal(new TimeOnly(02, 03, 04), result.CreationTime);
Expand Down
1 change: 0 additions & 1 deletion pipeline-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ steps:
includeNugetOrg: true
projects: |
**/*.csproj
!**/*Tests*.csproj
- task: DotNetCoreCLI@2
displayName: 'DotNet Test'
Expand Down

0 comments on commit 2917733

Please sign in to comment.