public void OptimizeReposSuccessTest() { // Prepare var mock = new Mock <ICommandRunner>(); mock.Setup(f => f.Run("git", It.IsAny <string>())) .Returns(0); IFixer fixer = new Fixer(new MetaInfo(), new Options(), mock.Object, "", null, null); // Act fixer.OptimizeRepos(); // Assert mock.Verify(f => f.Run("git", "gc"), Times.Once()); }