public void When_Solution_doesnt_exist_then_it_doesnt_throw() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { {Path.Combine(_sourceCodeDirectory, "file.txt"), new MockFileData("file.txt")} }); var solutionEditor = new ScriptsSolutionEditor(fileSystem, _sourceCodeDirectory); Assert.DoesNotThrow(solutionEditor.AddScriptsProjectsToSolution); }
public void DoesntAddAReferenceToTheScriptsProjectIfItAlreadyExists() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { {_solutionPath, new MockFileData(_projectReferenceString)} }); var solutionEditor = new ScriptsSolutionEditor(fileSystem, _sourceCodeDirectory); solutionEditor.AddScriptsProjectsToSolution(); Assert.AreEqual(_projectReferenceString, new MockFile(fileSystem).ReadAllText(_solutionPath)); }
public void IsCaseInsensitive() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { {_solutionPath, new MockFileData(_projectReferenceString.ToLower())} }); var solutionEditor = new ScriptsSolutionEditor(fileSystem, _sourceCodeDirectory); solutionEditor.AddScriptsProjectsToSolution(); Assert.IsTrue(_projectReferenceString.Equals(new MockFile(fileSystem).ReadAllText(_solutionPath), StringComparison.OrdinalIgnoreCase)); }
public void AddsAReferenceToTheScriptsProjectToTheSolutionFile() { var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData> { {_solutionPath, new MockFileData("EndProject")} }); var solutionEditor = new ScriptsSolutionEditor(fileSystem, _sourceCodeDirectory); solutionEditor.AddScriptsProjectsToSolution(); Assert.AreEqual("EndProject" + _projectReferenceString, new MockFile(fileSystem).ReadAllText(_solutionPath)); }