Ejemplo n.º 1
0
        public void AddLabels_LabelsNull_ThrowsArgumentNullException()
        {
            // Setup
            var plotView = new CategoryPlotView();

            // Call
            TestDelegate test = () => plotView.AddLabels(null);

            // Assert
            var exception = Assert.Throws <ArgumentNullException>(test);

            Assert.AreEqual("labels", exception.ParamName);
        }
Ejemplo n.º 2
0
        public void AddLabel_EmptyLabels_AbsoluteMaximumSet()
        {
            // Setup
            var plotView = new CategoryPlotView();

            // Call
            plotView.AddLabels(Enumerable.Empty <string>());

            // Assert
            CategoryAxis axis = plotView.Model.Axes.OfType <CategoryAxis>().First();

            Assert.AreEqual(0, axis.Labels.Count);
            Assert.AreEqual(0, axis.AbsoluteMaximum);
        }
Ejemplo n.º 3
0
        public void AddLabel_WithLabel_LabelAddedAndAbsoluteMaximumSet()
        {
            // Setup
            const string label    = "Test";
            var          plotView = new CategoryPlotView();

            // Call
            plotView.AddLabels(new[]
            {
                label
            });

            // Assert
            CategoryAxis axis = plotView.Model.Axes.OfType <CategoryAxis>().First();

            Assert.AreEqual(1, axis.Labels.Count);
            Assert.AreEqual(label, axis.Labels[0]);
            Assert.AreEqual(0.5, axis.AbsoluteMaximum);
        }
Ejemplo n.º 4
0
        public void ClearLabels_Always_LabelsCleared()
        {
            // Setup
            var plotView = new CategoryPlotView();

            plotView.AddLabels(new[]
            {
                "Test"
            });

            // Precondition
            CategoryAxis axis = plotView.Model.Axes.OfType <CategoryAxis>().First();

            Assert.AreEqual(1, axis.Labels.Count);

            // Call
            plotView.ClearLabels();

            // Assert
            CollectionAssert.IsEmpty(axis.Labels);
        }