Skip to content

Commit

Permalink
Convert all text files to CRLF.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseldredge committed Jul 26, 2012
1 parent dcf9c29 commit f8dd308
Show file tree
Hide file tree
Showing 48 changed files with 3,317 additions and 3,317 deletions.
1,744 changes: 872 additions & 872 deletions src/SlimJim.Installer/SlimJim.Installer.vdproj

Large diffs are not rendered by default.

124 changes: 62 additions & 62 deletions src/SlimJim.Test/Infrastructure/CsProjReaderTests.cs
@@ -1,13 +1,13 @@
using System.IO;
using NUnit.Framework;
using SlimJim.Infrastructure;
using SlimJim.Model;

namespace SlimJim.Test.Infrastructure
{
[TestFixture]
public class CsProjReaderTests
{
using System.IO;
using NUnit.Framework;
using SlimJim.Infrastructure;
using SlimJim.Model;

namespace SlimJim.Test.Infrastructure
{
[TestFixture]
public class CsProjReaderTests
{
private FileInfo file;

[Test]
Expand All @@ -18,60 +18,60 @@ public void ReadsFileContentsIntoObject()
Assert.That(project.Guid, Is.EqualTo("{4A37C916-5AA3-4C12-B7A8-E5F878A5CDBA}"));
Assert.That(project.AssemblyName, Is.EqualTo("MyProject"));
Assert.That(project.Path, Is.EqualTo(file.FullName));
Assert.That(project.ReferencedAssemblyNames, Is.EqualTo(new[]
{
"System",
"System.Core",
"System.Xml.Linq",
"System.Data.DataSetExtensions",
"Microsoft.CSharp",
"System.Data",
"System.Xml"
Assert.That(project.ReferencedAssemblyNames, Is.EqualTo(new[]
{
"System",
"System.Core",
"System.Xml.Linq",
"System.Data.DataSetExtensions",
"Microsoft.CSharp",
"System.Data",
"System.Xml"
}));
Assert.That(project.ReferencedProjectGuids, Is.EqualTo(new[]
{
"{99036BB6-4F97-4FCC-AF6C-0345A5089099}",
"{69036BB3-4F97-4F9C-AF2C-0349A5049060}"
Assert.That(project.ReferencedProjectGuids, Is.EqualTo(new[]
{
"{99036BB6-4F97-4FCC-AF6C-0345A5089099}",
"{69036BB3-4F97-4F9C-AF2C-0349A5049060}"
}));
}

[Test]
public void IgnoresNestedReferences()
{
}

[Test]
public void IgnoresNestedReferences()
{
CsProj project = GetProject("ConvertedReference");

Assert.That(project.ReferencedAssemblyNames, Is.Not.Contains("log4net"));
}

[Test]
public void TakesOnlyNameOfFullyQualifiedAssemblyName()
{
CsProj project = GetProject("FQAssemblyName");

Assert.That(project.ReferencedAssemblyNames, Contains.Item("NHibernate"));
}

[Test]
public void NoProjectReferencesDoesNotCauseNRE()
{
CsProj project = GetProject("NoProjectReferences");

Assert.That(project.ReferencedProjectGuids, Is.Empty);
}

[Test]
public void NoAssemblyName_ReturnsNull()
{
CsProj project = GetProject("BreaksThings");

Assert.That(project, Is.Null);
}

private CsProj GetProject(string fileName)
{
file = SampleFiles.SampleFileHelper.GetCsProjFile(fileName);
var reader = new CsProjReader();
return reader.Read(file);
}
}
Assert.That(project.ReferencedAssemblyNames, Is.Not.Contains("log4net"));
}

[Test]
public void TakesOnlyNameOfFullyQualifiedAssemblyName()
{
CsProj project = GetProject("FQAssemblyName");

Assert.That(project.ReferencedAssemblyNames, Contains.Item("NHibernate"));
}

[Test]
public void NoProjectReferencesDoesNotCauseNRE()
{
CsProj project = GetProject("NoProjectReferences");

Assert.That(project.ReferencedProjectGuids, Is.Empty);
}

[Test]
public void NoAssemblyName_ReturnsNull()
{
CsProj project = GetProject("BreaksThings");

Assert.That(project, Is.Null);
}

private CsProj GetProject(string fileName)
{
file = SampleFiles.SampleFileHelper.GetCsProjFile(fileName);
var reader = new CsProjReader();
return reader.Read(file);
}
}
}
196 changes: 98 additions & 98 deletions src/SlimJim.Test/Infrastructure/CsProjRepositoryTests.cs
@@ -1,99 +1,99 @@
using System.Collections.Generic;
using System.IO;
using NUnit.Framework;
using Rhino.Mocks;
using SlimJim.Infrastructure;
using SlimJim.Model;
using SlimJim.Test.SampleFiles;

namespace SlimJim.Test.Infrastructure
{
[TestFixture]
public class CsProjRepositoryTests
{
private const string StartPath = @"C:\Projects";
private const string SearchPath1 = @"C:\OtherProjects";
private const string SearchPath2 = @"C:\MoreProjects";
private readonly FileInfo file1 = SampleFileHelper.GetCsProjFile("Simple");
private readonly FileInfo file2 = SampleFileHelper.GetCsProjFile("Simple");
private readonly CsProj proj1 = new CsProj {AssemblyName = "Proj1"};
private readonly CsProj proj2 = new CsProj {AssemblyName = "Proj1"};
private ProjectFileFinder finder;
private CsProjReader reader;
private CsProjRepository repository;
private SlnGenerationOptions options;

[SetUp]
public void BeforeEach()
{
options = new SlnGenerationOptions(StartPath);
finder = MockRepository.GenerateStrictMock<ProjectFileFinder>();
reader = MockRepository.GenerateStrictMock<CsProjReader>();
repository = new CsProjRepository
{
Finder = finder,
Reader = reader
};
}

[TearDown]
public void AfterEach()
{
finder.VerifyAllExpectations();
reader.VerifyAllExpectations();
}

[Test]
public void CreatesOwnInstancesOfFinderAndReader()
{
repository = new CsProjRepository();
Assert.That(repository.Finder, Is.Not.Null, "Should have created instance of CsProjFinder.");
Assert.That(repository.Reader, Is.Not.Null, "Should have created instance of CsProjReader.");
}

[Test]
public void GetsFilesFromFinderAndProcessesThemWithCsProjReader()
{
finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List<FileInfo>{file1, file2});
reader.Expect(r => r.Read(file1)).Return(proj1);
reader.Expect(r => r.Read(file2)).Return(proj2);

List<CsProj> projects = repository.LookupCsProjsFromDirectory(options);

Assert.That(projects, Is.EqualTo(new[]{proj1, proj2}));
}

[Test]
public void GracefullyHandlesNullsFromReader()
{
finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List<FileInfo> { file1, file2 });
reader.Expect(r => r.Read(file1)).Return(proj1);
reader.Expect(r => r.Read(file2)).Return(null);

List<CsProj> projects = repository.LookupCsProjsFromDirectory(options);

Assert.That(projects, Is.EqualTo(new[] { proj1 }));
}

[Test]
public void ReadsFilesFromAdditionalSearchPathsAsWell()
{
options.AddAdditionalSearchPaths(new[] { SearchPath1, SearchPath2 });
finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List<FileInfo>());
finder.Expect(f => f.FindAllProjectFiles(SearchPath1)).Return(new List<FileInfo>());
finder.Expect(f => f.FindAllProjectFiles(SearchPath2)).Return(new List<FileInfo>());

repository.LookupCsProjsFromDirectory(options);
}

[Test]
public void IngoresDirectoryPatternsInOptions()
{
options.AddIgnoreDirectoryPatterns("Folder1", "Folder2");
finder.Expect(f => f.IgnorePatterns(new[] {"Folder1", "Folder2"}));
finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List<FileInfo>());

repository.LookupCsProjsFromDirectory(options);
}
}
using System.Collections.Generic;
using System.IO;
using NUnit.Framework;
using Rhino.Mocks;
using SlimJim.Infrastructure;
using SlimJim.Model;
using SlimJim.Test.SampleFiles;

namespace SlimJim.Test.Infrastructure
{
[TestFixture]
public class CsProjRepositoryTests
{
private const string StartPath = @"C:\Projects";
private const string SearchPath1 = @"C:\OtherProjects";
private const string SearchPath2 = @"C:\MoreProjects";
private readonly FileInfo file1 = SampleFileHelper.GetCsProjFile("Simple");
private readonly FileInfo file2 = SampleFileHelper.GetCsProjFile("Simple");
private readonly CsProj proj1 = new CsProj {AssemblyName = "Proj1"};
private readonly CsProj proj2 = new CsProj {AssemblyName = "Proj1"};
private ProjectFileFinder finder;
private CsProjReader reader;
private CsProjRepository repository;
private SlnGenerationOptions options;

[SetUp]
public void BeforeEach()
{
options = new SlnGenerationOptions(StartPath);
finder = MockRepository.GenerateStrictMock<ProjectFileFinder>();
reader = MockRepository.GenerateStrictMock<CsProjReader>();
repository = new CsProjRepository
{
Finder = finder,
Reader = reader
};
}

[TearDown]
public void AfterEach()
{
finder.VerifyAllExpectations();
reader.VerifyAllExpectations();
}

[Test]
public void CreatesOwnInstancesOfFinderAndReader()
{
repository = new CsProjRepository();
Assert.That(repository.Finder, Is.Not.Null, "Should have created instance of CsProjFinder.");
Assert.That(repository.Reader, Is.Not.Null, "Should have created instance of CsProjReader.");
}

[Test]
public void GetsFilesFromFinderAndProcessesThemWithCsProjReader()
{
finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List<FileInfo>{file1, file2});
reader.Expect(r => r.Read(file1)).Return(proj1);
reader.Expect(r => r.Read(file2)).Return(proj2);

List<CsProj> projects = repository.LookupCsProjsFromDirectory(options);

Assert.That(projects, Is.EqualTo(new[]{proj1, proj2}));
}

[Test]
public void GracefullyHandlesNullsFromReader()
{
finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List<FileInfo> { file1, file2 });
reader.Expect(r => r.Read(file1)).Return(proj1);
reader.Expect(r => r.Read(file2)).Return(null);

List<CsProj> projects = repository.LookupCsProjsFromDirectory(options);

Assert.That(projects, Is.EqualTo(new[] { proj1 }));
}

[Test]
public void ReadsFilesFromAdditionalSearchPathsAsWell()
{
options.AddAdditionalSearchPaths(new[] { SearchPath1, SearchPath2 });
finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List<FileInfo>());
finder.Expect(f => f.FindAllProjectFiles(SearchPath1)).Return(new List<FileInfo>());
finder.Expect(f => f.FindAllProjectFiles(SearchPath2)).Return(new List<FileInfo>());

repository.LookupCsProjsFromDirectory(options);
}

[Test]
public void IngoresDirectoryPatternsInOptions()
{
options.AddIgnoreDirectoryPatterns("Folder1", "Folder2");
finder.Expect(f => f.IgnorePatterns(new[] {"Folder1", "Folder2"}));
finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List<FileInfo>());

repository.LookupCsProjsFromDirectory(options);
}
}
}

0 comments on commit f8dd308

Please sign in to comment.