public void GetFromRecord() { DateTime before = DateTime.Now.AddMinutes(-1); DateTime after = DateTime.Now.AddMinutes(+1); int recordId = SaveRecord(EnergyRecords.NewRecord().MarkAsNew()); Assert.That(recordId, Is.GreaterThan(1000)); Assert.That(Records, Is.Not.Empty); SimpleEnergyModel model = Repository.FindById(recordId); Assert.That(model, Is.Not.Null); Assert.That(model.Location, Is.EqualTo(location)); Assert.That(model.StartTime, Is.GreaterThan(before).And.LessThan(after)); Assert.That(model.Duration, Is.EqualTo(90)); }
public void LoadModelWithStrings() { InMemoryRecord record = EnergyRecords.NewRecord().MarkAsNew(); Assert.That(record.Location, Is.EqualTo(location)); record.SetFieldValue("Cause Location", "Plant.Area"); record.SetFieldIdValue("Cause", "Shutdown", 100); record.SetFieldIdValue("Classification", "Unplanned Process", 200); SaveRecord(record); Assert.That(Records, Is.Not.Empty); int recordId = Records[0].RecordId; Assert.That(recordId, Is.GreaterThan(0)); IdentifierEnergyModel model = Repository.FindById(recordId); Assert.That(model, Is.Not.Null); Assert.That(model.Cause, Is.EqualTo(100)); Assert.That(model.Classification, Is.EqualTo(200)); }