public void EatValueExpressionTest()
        {
            // Arrange
            var snapshot = Mock.Of<ISnapshot>();
            var value = Mock.Of<ICSharpExpression>();
            var gotoCaseStatement = Mock.Of<IGotoCaseStatement>(t => t.ValueExpression == value);
            var eater = new Mock<IEater>();
            var gotoCaseStatementEater = new GotoCaseStatementEater(eater.Object);

            // Act
            gotoCaseStatementEater.Eat(snapshot, gotoCaseStatement);

            // Assert
            eater.Verify(t => t.Eat(snapshot, value), Times.Once);
        }
Ejemplo n.º 2
0
        public void EatValueExpressionTest()
        {
            // Arrange
            var snapshot               = Mock.Of <ISnapshot>();
            var value                  = Mock.Of <ICSharpExpression>();
            var gotoCaseStatement      = Mock.Of <IGotoCaseStatement>(t => t.ValueExpression == value);
            var eater                  = new Mock <IEater>();
            var gotoCaseStatementEater = new GotoCaseStatementEater(eater.Object);

            // Act
            gotoCaseStatementEater.Eat(snapshot, gotoCaseStatement);

            // Assert
            eater.Verify(t => t.Eat(snapshot, value), Times.Once);
        }
Ejemplo n.º 3
0
        public void AddValueExpressionToSnapshotTest()
        {
            // Arrange
            var snapshot          = new Mock <ISnapshot>();
            var value             = Mock.Of <ICSharpExpression>();
            var gotoCaseStatement = Mock.Of <IGotoCaseStatement>(t => t.ValueExpression == value);

            var eater = Mock.Of <IEater>(t => t.Eat(snapshot.Object, value) == ExpressionKind.None);
            var gotoCaseStatementEater = new GotoCaseStatementEater(eater);

            // Act
            gotoCaseStatementEater.Eat(snapshot.Object, gotoCaseStatement);

            // Assert
            snapshot.Verify(t => t.Add(ExpressionKind.None, value), Times.Once);
        }
        public void AddValueExpressionToSnapshotTest()
        {
            // Arrange
            var snapshot = new Mock<ISnapshot>();
            var value = Mock.Of<ICSharpExpression>();
            var gotoCaseStatement = Mock.Of<IGotoCaseStatement>(t => t.ValueExpression == value);

            var eater = Mock.Of<IEater>(t => t.Eat(snapshot.Object, value) == ExpressionKind.None);
            var gotoCaseStatementEater = new GotoCaseStatementEater(eater);

            // Act
            gotoCaseStatementEater.Eat(snapshot.Object, gotoCaseStatement);

            // Assert
            snapshot.Verify(t => t.Add(ExpressionKind.None, value), Times.Once);
        }