public void ResolveValue() { ModelFieldMapping fieldMapping = new ModelFieldMapping("Sample", typeof(DateTime)); string todayUtc = PersistenceHelper.ConvertToString(DateTime.Today.ToUniversalTime()); Model model = new Model { Id = 100, Sample = DateTime.Today }; ModelProperties <Model> modelProperties = new ModelProperties <Model>(); string value; Assert.That(fieldMapping.TryResolveValue(modelProperties, model, out value), Is.True); Assert.That(value, Is.EqualTo(todayUtc)); }
private void AddAuditRecord(InMemoryRecord record, DateTime editedTime, string displayName, string oldValue, string newValue, string user) { List <InMemoryAuditRecord> auditDatabase = amplaDatabase.GetAuditRecords(record.Module); GetView view = amplaConfiguration.GetViewForLocation(record.Module, record.Location); InMemoryAuditRecord auditRecord = new InMemoryAuditRecord { SetId = Convert.ToString(record.RecordId), Location = record.Location, RecordType = record.Module, EditedBy = "System Configuration.Users." + user, EditedDateTime = PersistenceHelper.ConvertToString(editedTime), Field = GetFieldNameFromDisplayName(view, displayName), OriginalValue = oldValue, EditedValue = newValue }; auditDatabase.Add(auditRecord); }