public void SetsTimestampsOnInsertTest() { var auditPropertyManager = new AuditPropertyManager(); // can use any EntityWithId var photoGroup = new PhotoGroup(); _dbContext.Add(photoGroup); var before = DateTimeOffset.Now; // TODO: see todo on interface IAuditPropertManager auditPropertyManager.SetTimestamps(_dbContext); var after = DateTimeOffset.Now; Assert.InRange(_dbContext.Entry(photoGroup).Property <DateTimeOffset>(Constants.InsertTimestampPropertyName).CurrentValue, before, after); Assert.InRange(_dbContext.Entry(photoGroup).Property <DateTimeOffset>(Constants.UpdateTimestampPropertyName).CurrentValue, before, after); Assert.Equal( _dbContext.Entry(photoGroup).Property <DateTimeOffset>(Constants.InsertTimestampPropertyName).CurrentValue, _dbContext.Entry(photoGroup).Property <DateTimeOffset>(Constants.UpdateTimestampPropertyName).CurrentValue); }