Esempio n. 1
0
        public void Visit_givenVisitor_callsVisitEdge()
        {
            var visitor = mMockRepository.DynamicMock<IGraphVisitor<string>>();
            var node = CreateNode();
            var edge = new Edge(node, node);

            using (mMockRepository.Record())
            {
                Expect.Call(visitor.VisitEdge(null))
                    .IgnoreArguments()
                    .Return("graph")
                    .Repeat.Once();
            }

            using (mMockRepository.Playback())
            {
                edge.Visit(visitor);
            }
        }
Esempio n. 2
0
 public void Visit_missingVisitor_throwsException()
 {
     var node = CreateNode();
     var edge = new Edge(node, node);
     edge.Visit<string>(null);
 }
Esempio n. 3
0
        public void Visit_givenVisitor_returnsVisitEdgeResult()
        {
            const string VisitEdgeResult = "graph";

            var visitor = mMockRepository.DynamicMock<IGraphVisitor<string>>();
            var node = CreateNode();
            var edge = new Edge(node, node);

            using (mMockRepository.Record())
            {
                Expect.Call(visitor.VisitEdge(null))
                    .IgnoreArguments()
                    .Return(VisitEdgeResult)
                    .Repeat.Once();
            }

            var result = edge.Visit(visitor);
            Assert.That(result, Is.EqualTo(VisitEdgeResult));
        }