Using Moq.It.IsAny to test a string starts with something
Try using:
Moq.It.Is<string>(x => x.StartsWith("ABC"))
try:
logger.Verify(x => x.WriteData(Moq.It.Is<string>(str => str.StartsWith("ABC"))), Times.Exactly(3));
you can see another example of It.Is:
// matching Func<int>, lazy evaluated
mock.Setup(foo => foo.Add(It.Is<int>(i => i % 2 == 0))).Returns(true);
that comes from Moq documentation: https://github.com/Moq/moq4/wiki/Quickstart