상속: IReferenceIntegrityCheck
            public Given_an_existing_reference()
            {
                this.reference = new BinaryReference
                {
                    Name = "test",
                    Path = "test.dll",
                    FullPath = "test.dll",
                    Referrer = "project"
                };

                var fileSystemMock = new MockFileSystem(new Dictionary<string, MockFileData>
                {
                    {"test.dll", new MockFileData(String.Empty)}
                });

                this.check = new ReferenceExistsCheck(fileSystemMock);
            }
예제 #2
0
 public ProjectIntegrityCheck(IFileSystem fileSystem, ReferenceRegistry wellknownReferencesRegistry, string libDirectory)
 {
     this.refGlobal = new BinaryReferenceIsGlobalCheck(wellknownReferencesRegistry);
     this.refExists = new ReferenceExistsCheck(fileSystem);
     this.refExternal = new BinaryReferenceInExternalLibrariesDirectoryCheck(libDirectory);
 }
예제 #3
0
 public SolutionIntegrityCheck(IFileSystem fileSystem, ProjectReference[] projectsInSolution, IProjectParser parser)
 {
     this.refExists = new ReferenceExistsCheck(fileSystem);
     this.refInSolution = new ProjectReferenceExistsInSolutionCheck(projectsInSolution, parser);
 }
            public void It_should_not_be_satisfied()
            {
                var reference = new BinaryReference
                {
                    Name = "system",
                    Path = null,
                    FullPath = null
                };

                var fileSystemMock = new MockFileSystem(new Dictionary<string, MockFileData>());
                var check = new ReferenceExistsCheck(fileSystemMock);

                Assert.IsFalse(check.IsSatisfiedBy(reference));
            }
            public void It_should_be_satisfied()
            {
                var reference = new BinaryReference
                {
                    Name = "test",
                    Path = Path.Combine("..", "test.dll"),
                    FullPath = Path.GetFullPath(Path.Combine("root", "test.dll"))
                };

                var fileSystemMock = new MockFileSystem(new Dictionary<string, MockFileData>
                {
                    {Path.GetFullPath(Path.Combine("root", "test.dll")), new MockFileData(String.Empty)}
                });

                var check = new ReferenceExistsCheck(fileSystemMock);

                Assert.IsTrue(check.IsSatisfiedBy(reference));
            }
            public Given_a_non_existent_project_in_a_solution_file()
            {
                this.reference = new ProjectReference
                {
                    Name = "test",
                    Path = "test.proj",
                    FullPath = "test.proj",
                    Referrer = "sol",
                    SourceType = ReferenceSourceType.Solution
                };

                var fileSystemMock = new MockFileSystem(new Dictionary<string, MockFileData>
                {
                    {"another.proj", new MockFileData(String.Empty)}
                });

                this.check = new ReferenceExistsCheck(fileSystemMock);
            }