public void EatRightExpressionTest() { // Arrange var snapshot = Mock.Of<ISnapshot>(); var right = Mock.Of<ICSharpExpression>(); var binaryExpression = Mock.Of<IBinaryExpression>(t => t.RightOperand == right); var eater = new Mock<IEater>(); var binaryExpressionEater = new BinaryExpressionEater(eater.Object); // Act binaryExpressionEater.Eat(snapshot, binaryExpression); // Assert eater.Verify(t => t.Eat(snapshot, right), Times.Once); }
public ExpressionKind RetrunKindTest(ExpressionKind leftKind, ExpressionKind rightKind) { // Arrange var snapshot = Mock.Of <ISnapshot>(); var left = Mock.Of <ICSharpExpression>(); var right = Mock.Of <ICSharpExpression>(); var binaryExpression = Mock.Of <IBinaryExpression>(t => t.LeftOperand == left && t.RightOperand == right); var eater = Mock.Of <IEater>(t => t.Eat(snapshot, left) == leftKind && t.Eat(snapshot, right) == rightKind); var binaryExpressionEater = new BinaryExpressionEater(eater); // Assert return(binaryExpressionEater.Eat(snapshot, binaryExpression)); }
public void EatRightExpressionTest() { // Arrange var snapshot = Mock.Of <ISnapshot>(); var right = Mock.Of <ICSharpExpression>(); var binaryExpression = Mock.Of <IBinaryExpression>(t => t.RightOperand == right); var eater = new Mock <IEater>(); var binaryExpressionEater = new BinaryExpressionEater(eater.Object); // Act binaryExpressionEater.Eat(snapshot, binaryExpression); // Assert eater.Verify(t => t.Eat(snapshot, right), Times.Once); }
public void AddRightExpressionToSnapshotTest() { // Arrange var snapshot = new Mock<ISnapshot>(); var right = Mock.Of<ICSharpExpression>(); var binaryExpression = Mock.Of<IBinaryExpression>(t => t.RightOperand == right); var eater = Mock.Of<IEater>(t => t.Eat(snapshot.Object, right) == ExpressionKind.None); var binaryExpressionEater = new BinaryExpressionEater(eater); // Act binaryExpressionEater.Eat(snapshot.Object, binaryExpression); // Assert snapshot.Verify(t => t.Add(ExpressionKind.None, right), Times.Once); }
public void AddRightExpressionToSnapshotTest() { // Arrange var snapshot = new Mock <ISnapshot>(); var right = Mock.Of <ICSharpExpression>(); var binaryExpression = Mock.Of <IBinaryExpression>(t => t.RightOperand == right); var eater = Mock.Of <IEater>(t => t.Eat(snapshot.Object, right) == ExpressionKind.None); var binaryExpressionEater = new BinaryExpressionEater(eater); // Act binaryExpressionEater.Eat(snapshot.Object, binaryExpression); // Assert snapshot.Verify(t => t.Add(ExpressionKind.None, right), Times.Once); }
public ExpressionKind RetrunKindTest(ExpressionKind leftKind, ExpressionKind rightKind) { // Arrange var snapshot = Mock.Of<ISnapshot>(); var left = Mock.Of<ICSharpExpression>(); var right = Mock.Of<ICSharpExpression>(); var binaryExpression = Mock.Of<IBinaryExpression>(t => t.LeftOperand == left && t.RightOperand == right); var eater = Mock.Of<IEater>(t => t.Eat(snapshot, left) == leftKind && t.Eat(snapshot, right) == rightKind); var binaryExpressionEater = new BinaryExpressionEater(eater); // Assert return binaryExpressionEater.Eat(snapshot, binaryExpression); }