public void RestoreCommandNoFilesToUse() { // Arrange var fileSystem = new MockFileSystem(); var restoreCommand = new RestoreCommand() { FileSystem = fileSystem }; // Assert ExceptionAssert.Throws<InvalidOperationException>( () => restoreCommand.DetermineRestoreMode(), "This folder contains no solution files, nor packages.config files."); }
public void RestoreCommandMultipleSolutionFiles() { // Arrange var fileSystem = new MockFileSystem(); fileSystem.AddFile("a.sln"); fileSystem.AddFile("b.sln"); var restoreCommand = new RestoreCommand() { FileSystem = fileSystem }; // Assert ExceptionAssert.Throws<InvalidOperationException>( () => restoreCommand.DetermineRestoreMode(), "This folder contains more than one solution file."); }
public void RestoreCommandPreferSolutionFile() { // Arrange var fileSystem = new MockFileSystem(); fileSystem.AddFile("a.sln"); fileSystem.AddFile("packages.config"); var restoreCommand = new RestoreCommand() { FileSystem = fileSystem }; // Act restoreCommand.DetermineRestoreMode(); // Assert Assert.True(restoreCommand.RestoringForSolution); Assert.Equal(fileSystem.GetFullPath("a.sln"), restoreCommand.SolutionFileFullPath); }