public void GetAxis() { var plot = new PlotModel { Title = "Get Axis Or Default" }; var verticalAxis = new LinearAxis { Key = "YAxis", Position = AxisPosition.Left }; var horizontalAxis = new LinearAxis { Key = "XAxis", Position = AxisPosition.Bottom }; plot.Axes.Add(verticalAxis); plot.Axes.Add(horizontalAxis); Assert.That(() => plot.GetAxis("ThisIsAnInvalidKey"), Throws.InvalidOperationException); }