public void TestEditSelectedFiles() { var operationsFactoryMock = new Mock <IOperationsFactory>(); var directoryServiceMock = new Mock <IDirectoryService>(); var fileServiceMock = new Mock <IFileService>(); var fileOpeningServiceMock = new Mock <IResourceOpeningService>(); var fileOperationsStateServiceMock = new Mock <IOperationsStateService>(); fileOpeningServiceMock .Setup(m => m.Open(FileName)) .Verifiable(); var pathServiceMock = new Mock <IPathService>(); IOperationsService operationsService = new OperationsService( operationsFactoryMock.Object, directoryServiceMock.Object, fileOpeningServiceMock.Object, fileServiceMock.Object, pathServiceMock.Object, fileOperationsStateServiceMock.Object); operationsService.OpenFiles(new[] { FileName }); fileOpeningServiceMock.Verify(m => m.Open(FileName), Times.Once()); }