Beispiel #1
0
        public void Cells()
        {
            var record = new GraphvizRecord();

            if (record.Cells is null)
            {
                throw new InvalidOperationException($"Cell has null {nameof(GraphvizRecord.Cells)}.");
            }

            var recordCollection = new GraphvizRecordCellCollection();

            record.Cells = recordCollection;
            Assert.AreSame(recordCollection, record.Cells);
        }
        public void Constructor()
        {
            var recordCollection = new GraphvizRecordCellCollection();

            CollectionAssert.IsEmpty(recordCollection);

            var cell1 = new GraphvizRecordCell();

            recordCollection.Add(cell1);
            CollectionAssert.AreEqual(new[] { cell1 }, recordCollection);

            var cell2     = new GraphvizRecordCell();
            var cellArray = new[] { cell1, cell2 };

            recordCollection = new GraphvizRecordCellCollection(cellArray);
            CollectionAssert.AreEqual(cellArray, recordCollection);

            var otherRecordCollection = new GraphvizRecordCellCollection(recordCollection);

            CollectionAssert.AreEqual(recordCollection, otherRecordCollection);
        }