public void Prepare_to_persist_should_set_the_stored_value() { var statement = new StatementExtension(); statement.prepareToPersist(); Assert.IsNotNull(statement.stored); }
public void Prepare_to_persist_should_set_an_id_if_one_is_not_set_already() { var statement = new StatementExtension(); statement.prepareToPersist(); Assert.IsNotNull(statement.id); }
public void Prepare_to_persist_should_overwrite_an_existing_stored_value() { var existingStored = DateTime.Parse("2008-11-01T19:35:00.0000000Z"); var statement = new StatementExtension(); statement.prepareToPersist(); Assert.AreNotEqual(existingStored, statement.stored); }
public async Task SavePerceptionAsync(StatementExtension statement) { if (statement == null) { return; } statement.prepareToPersist(); await _documentClient.CreateDocumentAsync(_perceptionCollectionUri, statement.ToJObject()); }
public void Prepare_to_persist_should_not_overwrite_an_existing_id() { var existingId = Guid.Parse("9245fe4a-d402-451c-b9ed-9c1a04247482"); var statement = new StatementExtension() { id = existingId }; statement.prepareToPersist(); Assert.AreEqual(existingId, statement.id); }