public async Task SaveDateTimeProperty() { var db = new DateTimePropertyDatabase(); db.DateTimeProperty = new DateTime(2001, 2, 3, 4, 5, 6); await db.WaitForIdle(); var value = DateTime.ParseExact(File.ReadAllText(((ISexyDatabase)db).Node.PropertyNodes.Values.Cast <DbValuePropertyNode>().Single().File.FullName), "o", null); Assert.AreEqual(db.DateTimeProperty, value); }
public async Task LoadDateTimeProperty() { var db = new DateTimePropertyDatabase(); db.DateTimeProperty = new DateTime(2001, 2, 3, 4, 5, 6); await db.WaitForIdle(); var file = ((ISexyDatabase)db).Node.PropertyNodes.Values.Cast <DbValuePropertyNode>().Single().File; await db.EditFile(file, new DateTime(2002, 3, 4, 5, 6, 7).ToString("o")); Assert.AreEqual(new DateTime(2002, 3, 4, 5, 6, 7), db.DateTimeProperty); }