Example #1
0
        public void GivenOnePathToOneDirectory_WhenInThisDirectoryIsNotAnySolution_ThenOneDirectoryNotFoundException_ShouldBeThrown()
        {
            var mockFileSystem = new MockFileSystem();
            var cut            = new EntryPointLocator(mockFileSystem);

            Action action = () => cut.GetEntryPoint(@"c:\foo\bar\");

            action.Should().Throw <DirectoryNotFoundException>();
        }
Example #2
0
        public void GivenOnePathToOneProjectFile_WhenInThisFileDoesNotExist_ThenOneDirectoryNotFoundException_ShouldBeThrown()
        {
            var mockFileSystem = new MockFileSystem();

            mockFileSystem.AddDirectory(@"c:\foo\bar");
            var cut = new EntryPointLocator(mockFileSystem);

            Action action = () => cut.GetEntryPoint(@"c:\foo\bar\aa.fooproj");

            action.Should().Throw <FileNotFoundException>();
        }
Example #3
0
        public void GivenOnePathToOneDirectory_WhenThisDirectoryContainsTwoSolutionFiles_ThenOneException_ShouldBeThrown()
        {
            var mockFileSystem = new MockFileSystem();

            mockFileSystem.AddFile(@"c:\foo\bar\xyz.sln", new MockFileData(""));
            mockFileSystem.AddFile(@"c:\foo\bar\g.sln", new MockFileData(""));
            var cut = new EntryPointLocator(mockFileSystem);

            Action action = () => cut.GetEntryPoint(@"c:\foo\bar\");

            action.Should().Throw <InvalidOperationException>();
        }
Example #4
0
        public void GivenOnePathToOneSolution_WhenInThisSolutionDoesExist_ThenThisSolution_ShouldBeResolved()
        {
            var mockFileSystem = new MockFileSystem();

            mockFileSystem.AddFile(@"c:\foo\bar\xyz.sln", new MockFileData(""));
            var cut = new EntryPointLocator(mockFileSystem);

            var actualResult = cut.GetEntryPoint(@"c:\foo\bar\xyz.sln");

            using (var _ = new AssertionScope())
            {
                actualResult.Type.Should().Be(EntryPointType.Solution);
                actualResult.File.FullName.Should().Be(@"c:\foo\bar\xyz.sln");
            }
        }