Ejemplo n.º 1
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsTooltipFormattingStringPropertyToEqualTooltipPropertyOfFormattingStringsPropertyOfParameter()
        {
            DocumentOptions testSource = GetDocumentOptions();
            TrainGraphModel testObject = GetTrainGraphModel();

            testObject.SetPropertiesFromDocumentOptions(testSource);

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

            testObject.SetPropertiesFromDocumentOptions(null);

            Assert.AreEqual(ttf, testObject.TooltipFormattingString);
        }
Ejemplo n.º 3
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsGraphEditStylePropertyToEqualGraphEditStylePropertyOfParameter()
        {
            DocumentOptions testSource = GetDocumentOptions();
            TrainGraphModel testObject = GetTrainGraphModel();

            testObject.SetPropertiesFromDocumentOptions(testSource);

            Assert.AreEqual(testSource.GraphEditStyle, testObject.GraphEditStyle);
        }
Ejemplo n.º 4
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotChangeDisplayTrainLabelsPropertyIfParameterIsNull()
        {
            TrainGraphModel testObject    = GetTrainGraphModel();
            bool            displayLabels = testObject.DisplayTrainLabels;

            testObject.SetPropertiesFromDocumentOptions(null);

            Assert.AreEqual(displayLabels, testObject.DisplayTrainLabels);
        }
Ejemplo n.º 5
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotChangeGraphEditStylePropertyIfParameterIsNull()
        {
            TrainGraphModel testObject     = GetTrainGraphModel();
            GraphEditStyle  graphEditStyle = testObject.GraphEditStyle;

            testObject.SetPropertiesFromDocumentOptions(null);

            Assert.AreEqual(graphEditStyle, testObject.GraphEditStyle);
        }
Ejemplo n.º 6
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodSetsDisplayTrainLabelsPropertyToEqualDisplayTrainLabelsOnGraphsPropertyOfParameter()
        {
            DocumentOptions testSource = GetDocumentOptions();
            TrainGraphModel testObject = GetTrainGraphModel();

            testObject.SetPropertiesFromDocumentOptions(testSource);

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

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

            Assert.AreSame(testSelection, testOutput);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 10
0
        public void TrainGraphModelClassSetPropertiesFromDocumentOptionsMethodDoesNotCrashIfParameterIsNull()
        {
            TrainGraphModel testObject = GetTrainGraphModel();

            testObject.SetPropertiesFromDocumentOptions(null);
        }