using System; using System.Collections.ObjectModel; using Core.Components.Charting.Data; using NUnit.Framework; namespace Core.Components.Charting.Test.Data { [TestFixture] public class LineDataTest { [Test] public void Constructor_NullPoints_ThrowsArgumentNullException() { // Call TestDelegate test = () => new LineData(null); // Assert Assert.Throws(test); } [Test] public void Constructor_WithEmptyPoints_CreatesNewICharData() { // Setup var points = new Collection>(); // Call var data = new LineData(points); // Assert Assert.IsInstanceOf(data); Assert.AreNotSame(points, data.Points); } [Test] public void Constructor_WithPoints_CreatesNewICharData() { // Setup var points = CreateTestPoints(); // Call var data = new LineData(points); // Assert Assert.IsInstanceOf(data); Assert.AreNotSame(points, data.Points); CollectionAssert.AreEqual(points, data.Points); } private Collection> CreateTestPoints() { return new Collection> { new Tuple(0.0, 1.1), new Tuple(1.0, 2.1), new Tuple(1.6, 1.6) }; } } }