コード例 #1
0
ファイル: ProjectTreeTests.cs プロジェクト: Samarkin/pustota
        public void ProjectRepositoryBasics()
        {
            var entryPoint = new RepositoryEntryPoint("fake project folder path", _fileIOMock.Object);
            var serializer = new Mock <IProjectSerializer>();

            var loader = new ProjectTreeLoader(entryPoint, serializer.Object, _fileIOMock.Object);
        }
コード例 #2
0
 public ProjectTreeLoader(
     RepositoryEntryPoint projectRepositoryPath,
     IProjectSerializer serializer,
     IFileSystemAccess fileIo)
 {
     _projectRepositoryPath = projectRepositoryPath;
     _serializer            = serializer;
     _fileIO = fileIo;
 }
コード例 #3
0
ファイル: ProjectTreeTests.cs プロジェクト: Samarkin/pustota
        public void ProjectRepositoryLoadAllFoldersTest()
        {
            var entryPoint = new RepositoryEntryPoint(_topFolder, _fileIOMock.Object);

            var loader   = new ProjectTreeLoader(entryPoint, _serializer, _fileIOMock.Object);
            var projects = loader.LoadProjects().ToList();

            Assert.That(projects.Count, Is.EqualTo(2));
        }
コード例 #4
0
ファイル: ProjectTreeTests.cs プロジェクト: Samarkin/pustota
        public void ProjectRepositoryLoadViaModulesJustOneTest()
        {
            var entryPoint = new RepositoryEntryPoint(_topProjectPath, _fileIOMock.Object);

            var loader   = new ProjectTreeLoader(entryPoint, _serializer, _fileIOMock.Object);
            var projects = loader.LoadProjects().ToList();

            Assert.That(projects.Count, Is.EqualTo(1));
        }
コード例 #5
0
ファイル: ProjectTreeTests.cs プロジェクト: Samarkin/pustota
        public void SingleProjectLoadTest()
        {
            string projectPath = "fake project path";
            var    entryPoint  = new RepositoryEntryPoint(projectPath, _fileIOMock.Object);

            var loader = new ProjectTreeLoader(entryPoint, _serializer, _fileIOMock.Object);

            var container = loader.LoadProjectFile(_topProjectPath);

            Assert.That(container.Project, Is.Not.Null);
            Assert.That(container.Project.ArtifactId, Is.EqualTo(_topProject.ArtifactId));
        }
コード例 #6
0
ファイル: ProjectTreeTests.cs プロジェクト: Samarkin/pustota
        public void ProjectRepositoryLoadViaModulesAllTest()
        {
            _topProject.Modules.Add(new Module {
                Path = _secondFolderName
            });
            var content = _serializer.Serialize(_topProject);

            _fileIOMock.Setup(io => io.ReadAllText(_topProjectPath)).Returns(content);

            var entryPoint = new RepositoryEntryPoint(_topProjectPath, _fileIOMock.Object);

            var loader   = new ProjectTreeLoader(entryPoint, _serializer, _fileIOMock.Object);
            var projects = loader.LoadProjects().ToList();

            Assert.That(projects.Count, Is.EqualTo(2));
        }