public void EatBodyTest() { // Arrange var snapshot = Mock.Of<ISnapshot>(); var body = Mock.Of<ICSharpStatement>(); var unsafeCodeFixedStatement = Mock.Of<IUnsafeCodeFixedStatement>(t => t.Body == body); Mock.Get(unsafeCodeFixedStatement) .Setup(t => t.PointerDeclarations) .Returns(new TreeNodeCollection<IUnsafeCodeFixedPointerDeclaration>(new IUnsafeCodeFixedPointerDeclaration[0])); var eater = new Mock<IEater>(); var unsafeCodeFixedStatementEater = new UnsafeCodeFixedStatementEater(eater.Object); // Act unsafeCodeFixedStatementEater.Eat(snapshot, unsafeCodeFixedStatement); // Assert eater.Verify(t => t.Eat(snapshot, body), Times.Once); }
public void EatBodyTest() { // Arrange var snapshot = Mock.Of <ISnapshot>(); var body = Mock.Of <ICSharpStatement>(); var unsafeCodeFixedStatement = Mock.Of <IUnsafeCodeFixedStatement>(t => t.Body == body); Mock.Get(unsafeCodeFixedStatement) .Setup(t => t.PointerDeclarations) .Returns(new TreeNodeCollection <IUnsafeCodeFixedPointerDeclaration>(new IUnsafeCodeFixedPointerDeclaration[0])); var eater = new Mock <IEater>(); var unsafeCodeFixedStatementEater = new UnsafeCodeFixedStatementEater(eater.Object); // Act unsafeCodeFixedStatementEater.Eat(snapshot, unsafeCodeFixedStatement); // Assert eater.Verify(t => t.Eat(snapshot, body), Times.Once); }