コード例 #1
0
            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);
            }
コード例 #2
0
            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));
            }
コード例 #3
0
            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));
            }
コード例 #4
0
            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));
            }