コード例 #1
0
        public void AddInstance_Should_Create_Instance_And_Add_It_To_The_Tracker() {
            var tracker = new ConventionTracker();
            var expression = new ConventionCollectionSetupExpression(tracker);

            Assert.AreEqual(tracker.NodeConventions.Count, 0);
            Assert.AreEqual(expression.AddInstance(new TestNodeConvention()), expression);
            Assert.AreEqual(tracker.NodeConventions.Count, 1);

            Assert.AreEqual(tracker.EdgeConventions.Count, 0);
            Assert.AreEqual(expression.AddInstance(new TestEdgeConvention()), expression);
            Assert.AreEqual(tracker.EdgeConventions.Count, 1);
        }
コード例 #2
0
 public void AddInstance_Should_Throw_For_Conventions_Other_Than_Edge_And_Node() {
     var tracker = new ConventionTracker();
     var expression = new ConventionCollectionSetupExpression(tracker);
     expression.AddInstance(new DummyConvention());
 }