Skip to content
Merged
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
11 changes: 11 additions & 0 deletions Float.TinCan.ActivityLibrary.Tests/TinCanStatementBuilder.tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@ public void TestBuildStatement()
.Build();
Assert.NotNull(statement);
}

[Fact]
public void TestDefaultStatementTimestamp()
{
var statement = new TinCanStatementBuilder()
.Build();

// The default timestamp should be (approximately) now.
Assert.InRange(statement.timestamp ?? new System.DateTime(), System.DateTime.UtcNow.AddSeconds(-1), System.DateTime.UtcNow);
System.Console.WriteLine(statement.ToJSON());
}
}
}
2 changes: 1 addition & 1 deletion Float.TinCan.ActivityLibrary/TinCanStatementBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TinCanStatementBuilder
/// <summary>
/// The timestamp for the statement to be built. Optional.
/// </summary>
DateTime timestamp;
DateTime? timestamp;

/// <summary>
/// Gets the session ID for the statement to be build. Optional.
Expand Down