public void DateTimeNode_Open_Edit_SerializesCorrectly() { var path = Path.Combine(TestDirectory, "core", "dateTime", "DateTime.dyn"); CurrentDynamoModel.OpenFileFromPath(path); var node = CurrentDynamoModel.CurrentWorkspace.FirstNodeFromWorkspace<DateTime>(); var testDate = new System.DateTime(2150, 1, 1, 12, 0, 0); node.Value = testDate; CurrentDynamoModel.CurrentWorkspace.SaveAs(tempPath, CurrentDynamoModel.EngineController.LiveRunnerRuntimeCore); CurrentDynamoModel.OpenFileFromPath(tempPath); node = CurrentDynamoModel.CurrentWorkspace.FirstNodeFromWorkspace<DateTime>(); var dt = (System.DateTime)GetPreviewValue(node.GUID.ToString()); Assert.AreEqual(string.Format("{0:" + PreferenceSettings.DefaultDateFormat + "}", dt), testDate.ToString(PreferenceSettings.DefaultDateFormat)); }
public void DateTimeNode_Open_Edit_SerializesCorrectly() { var path = Path.Combine(TestDirectory, "core", "dateTime", "DateTime.dyn"); CurrentDynamoModel.OpenFileFromPath(path); var node = CurrentDynamoModel.CurrentWorkspace.FirstNodeFromWorkspace <DateTime>(); var testDate = new System.DateTime(2150, 1, 1, 12, 0, 0); node.Value = testDate; CurrentDynamoModel.CurrentWorkspace.SaveAs(tempPath, CurrentDynamoModel.EngineController.LiveRunnerRuntimeCore); CurrentDynamoModel.OpenFileFromPath(tempPath); node = CurrentDynamoModel.CurrentWorkspace.FirstNodeFromWorkspace <DateTime>(); var dt = (System.DateTime)GetPreviewValue(node.GUID.ToString()); Assert.AreEqual(string.Format("{0:" + PreferenceSettings.DefaultDateFormat + "}", dt), testDate.ToString(PreferenceSettings.DefaultDateFormat)); }