public void IsBlockOf_BlockNodeWithNullName_True()
 {
     var block = MockRepository.GenerateStub<IBlock>();
     block.Stub(b => b.Name).Return(null);
     var blockNode = new BlockSyntacticNode(block, Enumerable.Empty<ISyntacticNode>());
     Assert.That(blockNode.IsBlockOf("block1"), Is.False);
 }
 public void Block_BlockStub_Same()
 {
     var block = MockRepository.GenerateStub<IBlock>();
     var nodes = Enumerable.Empty<ISyntacticNode>();
     var blockNode = new BlockSyntacticNode(block, nodes);
     Assert.That(blockNode.Block, Is.SameAs(block));
 }
Пример #3
0
 public void CheckResult_BlockNode_Throw()
 {
     var node = new BlockSyntacticNode(
         MockRepository.GenerateStub<IBlock>(),
         Enumerable.Empty<ISyntacticNode>());
     var translator = new Translator(Enumerable.Empty<ISyntaxRewriter>());
     translator.CheckResult(node);
 }
 public void Nodes_SomeList_Same()
 {
     var block = MockRepository.GenerateStub<IBlock>();
     var nodes = new[]
     {
         MockRepository.GenerateStub<ISyntacticNode>(),
         MockRepository.GenerateStub<ISyntacticNode>()
     };
     var blockNode = new BlockSyntacticNode(block, nodes);
     Assert.That(blockNode.Nodes, Is.SameAs(nodes));
 }
 public void Nodes_Null_Null()
 {
     var block = MockRepository.GenerateStub<IBlock>();
     var blockNode = new BlockSyntacticNode(block, null);
     Assert.That(blockNode.Nodes, Is.Null);
 }
Пример #6
0
 public void CheckResult_NonTermNode_ThrowException()
 {
     var rules = new Dictionary<IResolverType, IEnumerable<IResolver>>();
     var node = new BlockSyntacticNode(
         MockRepository.GenerateStub<IBlock>(), 
         Enumerable.Empty<ISyntacticNode>());
     var linkedClass = MockRepository.GenerateStub<ILinkedLibrary>();
     var linker = new Linker(rules, linkedClass);
     linker.CheckResult(node);
 }