public void TestFileServiceOpeningWindows() { var processServiceMock = new Mock <IProcessService>(); processServiceMock .Setup(m => m.Run(FileName)) .Verifiable(); var fileOpeningService = new WindowsResourceOpeningService(processServiceMock.Object); fileOpeningService.Open(FileName); processServiceMock.Verify(m => m.Run(FileName), Times.Once()); }
public void TestFileServiceOpeningWindows() { const string fileName = "File.txt"; const string command = "explorer"; var arguments = $"\"{fileName}\""; var processServiceMock = new Mock <IProcessService>(); processServiceMock .Setup(m => m.Run(command, arguments)) .Verifiable(); var fileOpeningService = new WindowsResourceOpeningService(processServiceMock.Object); fileOpeningService.Open(fileName); processServiceMock.Verify(m => m.Run(command, arguments), Times.Once()); }