public void ItIsAny() { var mock = new Mock <IPropertyManager>(); var nameUser = new PropertyManagerConsumer(mock.Object); nameUser.ChangeRemoteName("Hamid"); mock.Verify(m => m.MutateFirstName(It.IsAny <string>()), Times.Once); }
public void Verify() { var mock = new Mock <IPropertyManager>(); var nameUser = new PropertyManagerConsumer(mock.Object); nameUser.ChangeRemoteName("My dear old wig"); //we are verifying that ChangeRemoteName sends the correct string to MutateFirstName mock.Verify(m => m.MutateFirstName(It.Is <string>(a => a == "My dear old wig")), Times.Once); }