public void PlainTextCallVisitor_VisitMethod() { var visitorMock = new Mock <Visitor>(); var plainText = new PlainText { Text = "Some plain text" }; plainText.Visit(visitorMock.Object); visitorMock.Verify(visitor => visitor.VisitPlainText(It.Is <PlainText>(text => string.Equals(text.Text, plainText.Text, StringComparison.Ordinal))), Times.Once); }