コード例 #1
0
        /// <summary>
        /// Adds a record node with the specified name to the graph.
        /// </summary>
        /// <param name="name">The name of the record node to create.</param>
        /// <returns>
        /// A record expression for configuring the record.
        /// </returns>
        public IRootRecordExpression WithName(string name) {
            var recordGroup = new RecordGroup();
            var node = new RecordNode(name, recordGroup);
            
            graph.AddNode(node);

            var expression = new RootRecordExpression(node);
            return expression;
        }
コード例 #2
0
        public void Customize_Should_Apply_Configuration_To_Node()
        {
            var graph = MockRepository.GenerateMock<IGraph>();
            var group = new RecordGroup();
            var node = new RecordNode("a", group);

            Assert.AreEqual(node.Attributes.CurrentAttributes.Count, 0);

            new RootRecordExpression(node).Customize(x => x.WithColor(Color.Black));

            Assert.AreEqual(node.Attributes.CurrentAttributes.Count, 1);
        }