public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsTooltipFormattingStringPropertyToEqualTooltipPropertyOfFormattingStringsPropertyOfParameter() { DocumentOptions testSource = GetDocumentOptions(); TrainGraphModel testObject = GetTrainGraphModel(); testObject.SetPropertiesFromDocumentOptions(testSource); Assert.AreEqual(testSource.FormattingStrings.Tooltip, testObject.TooltipFormattingString); }
public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotChangeTooltipFormattingStringPropertyIfParameterIsNull() { TrainGraphModel testObject = GetTrainGraphModel(); string ttf = testObject.TooltipFormattingString; testObject.SetPropertiesFromDocumentOptions(null); Assert.AreEqual(ttf, testObject.TooltipFormattingString); }
public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsGraphEditStylePropertyToEqualGraphEditStylePropertyOfParameter() { DocumentOptions testSource = GetDocumentOptions(); TrainGraphModel testObject = GetTrainGraphModel(); testObject.SetPropertiesFromDocumentOptions(testSource); Assert.AreEqual(testSource.GraphEditStyle, testObject.GraphEditStyle); }
public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotChangeDisplayTrainLabelsPropertyIfParameterIsNull() { TrainGraphModel testObject = GetTrainGraphModel(); bool displayLabels = testObject.DisplayTrainLabels; testObject.SetPropertiesFromDocumentOptions(null); Assert.AreEqual(displayLabels, testObject.DisplayTrainLabels); }
public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotChangeGraphEditStylePropertyIfParameterIsNull() { TrainGraphModel testObject = GetTrainGraphModel(); GraphEditStyle graphEditStyle = testObject.GraphEditStyle; testObject.SetPropertiesFromDocumentOptions(null); Assert.AreEqual(graphEditStyle, testObject.GraphEditStyle); }
public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsDisplayTrainLabelsPropertyToEqualDisplayTrainLabelsOnGraphsPropertyOfParameter() { DocumentOptions testSource = GetDocumentOptions(); TrainGraphModel testObject = GetTrainGraphModel(); testObject.SetPropertiesFromDocumentOptions(testSource); Assert.AreEqual(testSource.DisplayTrainLabelsOnGraphs, testObject.DisplayTrainLabels); }
public void TrainGraphModelClassSelectedTrainPropertyHasConventionalPersistence() { TrainGraphModel testObject = GetTrainGraphModel(); Train testSelection = new Train(); testObject.SelectedTrain = testSelection; Train testOutput = testObject.SelectedTrain; Assert.AreSame(testSelection, testOutput); }
public void TrainGraphModelClassSelectedTrainPropertySetMethodDoesNotFireEventWhenPropertyIsNullAndIsSetToNull() { TrainGraphModel testObject = GetTrainGraphModel(); List <TrainEventArgs> capturedEventArgs = new List <TrainEventArgs>(); List <object> capturedSenders = new List <object>(); testObject.SelectedTrainChanged += (s, e) => { capturedSenders.Add(s); capturedEventArgs.Add(e); }; testObject.SelectedTrain = null; Assert.AreEqual(0, capturedSenders.Count); Assert.AreEqual(0, capturedEventArgs.Count); }
public void TrainGraphModelClassSelectedTrainPropertySetMethodFiresEventWhenPropertyIsSetToDifferentValue() { TrainGraphModel testObject = GetTrainGraphModel(); List <TrainEventArgs> capturedEventArgs = new List <TrainEventArgs>(); List <object> capturedSenders = new List <object>(); testObject.SelectedTrainChanged += (s, e) => { capturedSenders.Add(s); capturedEventArgs.Add(e); }; Train testSelection = new Train(); testObject.SelectedTrain = testSelection; Assert.AreEqual(1, capturedSenders.Count); Assert.AreSame(testObject, capturedSenders[0]); Assert.AreEqual(1, capturedEventArgs.Count); Assert.AreSame(testSelection, capturedEventArgs[0].Train); }
public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotCrashIfParameterIsNull() { TrainGraphModel testObject = GetTrainGraphModel(); testObject.SetPropertiesFromDocumentOptions(null); }