public void ReturnStubCandidateTest()
        {
            // Arrange
            var snapshot = Mock.Of<ISnapshot>();
            var anonymousMethodExpression = Mock.Of<IAnonymousMethodExpression>();
            Mock.Get(anonymousMethodExpression).Setup(t => t.ParameterDeclarations)
                .Returns(new TreeNodeCollection<IAnonymousMethodParameterDeclaration>(new IAnonymousMethodParameterDeclaration[0]));
            var eater = Mock.Of<IEater>();
            var anonymousMethodExpressionEater = new AnonymousMethodExpressionEater(eater);

            // Act
            var kind = anonymousMethodExpressionEater.Eat(snapshot, anonymousMethodExpression);

            // Assert
            Assert.AreEqual(kind, ExpressionKind.StubCandidate);
        }
        public void ReturnStubCandidateTest()
        {
            // Arrange
            var snapshot = Mock.Of <ISnapshot>();
            var anonymousMethodExpression = Mock.Of <IAnonymousMethodExpression>();

            Mock.Get(anonymousMethodExpression).Setup(t => t.ParameterDeclarations)
            .Returns(new TreeNodeCollection <IAnonymousMethodParameterDeclaration>(new IAnonymousMethodParameterDeclaration[0]));
            var eater = Mock.Of <IEater>();
            var anonymousMethodExpressionEater = new AnonymousMethodExpressionEater(eater);

            // Act
            var kind = anonymousMethodExpressionEater.Eat(snapshot, anonymousMethodExpression);

            // Assert
            Assert.AreEqual(kind, ExpressionKind.StubCandidate);
        }
        public void EatParametersTest()
        {
            // Arrange
            var parameterDeclaration = Mock.Of<IAnonymousMethodParameterDeclaration>();
            var anonymousMethodExpression = Mock.Of<IAnonymousMethodExpression>();
            Mock.Get(anonymousMethodExpression).Setup(t => t.ParameterDeclarations)
                .Returns(new TreeNodeCollection<IAnonymousMethodParameterDeclaration>(new[] { parameterDeclaration }));
            var snapshot = Mock.Of<ISnapshot>();
            var eater = new Mock<IEater>();
            var anonymousMethodExpressionEater = new AnonymousMethodExpressionEater(eater.Object);

            // Act
            anonymousMethodExpressionEater.Eat(snapshot, anonymousMethodExpression);

            // Assert
            eater.Verify(t => t.Eat(snapshot, parameterDeclaration));
        }
        public void EatBodyTest()
        {
            // Arrange
            var snapshot = Mock.Of <ISnapshot>();
            var body     = Mock.Of <IBlock>();
            var anonymousMethodExpression = Mock.Of <IAnonymousMethodExpression>(t => t.Body == body);

            Mock.Get(anonymousMethodExpression).Setup(t => t.ParameterDeclarations)
            .Returns(new TreeNodeCollection <IAnonymousMethodParameterDeclaration>(new IAnonymousMethodParameterDeclaration[0]));
            var eater = new Mock <IEater>();
            var anonymousMethodExpressionEater = new AnonymousMethodExpressionEater(eater.Object);

            // Act
            anonymousMethodExpressionEater.Eat(snapshot, anonymousMethodExpression);

            // Assert
            eater.Verify(t => t.Eat(snapshot, body));
        }