示例#1
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsTooltipFormattingStringPropertyToEqualTooltipPropertyOfFormattingStringsPropertyOfParameter()
        {
            DocumentOptions testSource = GetDocumentOptions();
            TrainGraphModel testObject = GetTrainGraphModel();

            testObject.SetPropertiesFromDocumentOptions(testSource);

            Assert.AreEqual(testSource.FormattingStrings.Tooltip, testObject.TooltipFormattingString);
        }
示例#2
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotChangeTooltipFormattingStringPropertyIfParameterIsNull()
        {
            TrainGraphModel testObject = GetTrainGraphModel();
            string          ttf        = testObject.TooltipFormattingString;

            testObject.SetPropertiesFromDocumentOptions(null);

            Assert.AreEqual(ttf, testObject.TooltipFormattingString);
        }
示例#3
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsGraphEditStylePropertyToEqualGraphEditStylePropertyOfParameter()
        {
            DocumentOptions testSource = GetDocumentOptions();
            TrainGraphModel testObject = GetTrainGraphModel();

            testObject.SetPropertiesFromDocumentOptions(testSource);

            Assert.AreEqual(testSource.GraphEditStyle, testObject.GraphEditStyle);
        }
示例#4
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotChangeDisplayTrainLabelsPropertyIfParameterIsNull()
        {
            TrainGraphModel testObject    = GetTrainGraphModel();
            bool            displayLabels = testObject.DisplayTrainLabels;

            testObject.SetPropertiesFromDocumentOptions(null);

            Assert.AreEqual(displayLabels, testObject.DisplayTrainLabels);
        }
示例#5
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotChangeGraphEditStylePropertyIfParameterIsNull()
        {
            TrainGraphModel testObject     = GetTrainGraphModel();
            GraphEditStyle  graphEditStyle = testObject.GraphEditStyle;

            testObject.SetPropertiesFromDocumentOptions(null);

            Assert.AreEqual(graphEditStyle, testObject.GraphEditStyle);
        }
示例#6
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsDisplayTrainLabelsPropertyToEqualDisplayTrainLabelsOnGraphsPropertyOfParameter()
        {
            DocumentOptions testSource = GetDocumentOptions();
            TrainGraphModel testObject = GetTrainGraphModel();

            testObject.SetPropertiesFromDocumentOptions(testSource);

            Assert.AreEqual(testSource.DisplayTrainLabelsOnGraphs, testObject.DisplayTrainLabels);
        }
示例#7
0
        public void TrainGraphModelClassSelectedTrainPropertyHasConventionalPersistence()
        {
            TrainGraphModel testObject    = GetTrainGraphModel();
            Train           testSelection = new Train();

            testObject.SelectedTrain = testSelection;
            Train testOutput = testObject.SelectedTrain;

            Assert.AreSame(testSelection, testOutput);
        }
示例#8
0
        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);
        }
示例#9
0
        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);
        }
示例#10
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotCrashIfParameterIsNull()
        {
            TrainGraphModel testObject = GetTrainGraphModel();

            testObject.SetPropertiesFromDocumentOptions(null);
        }