Inheritance: IReferenceIntegrityCheck
Ejemplo n.º 1
0
        public ProjectIntegrity(ReferenceRegistry wellKnownLibraries, string libDirectory)
        {
            var check = new ProjectIntegrityCheck(new FileSystem(), wellKnownLibraries, libDirectory);
            var parser = new MsBuildProjectParser(new XmlDocumentLoader());

            this.referenceIntegrity = new ReferenceIntegrity(check, parser.ParseBinaryReferences);
        }
            public Given_a_reference_without_path_not_in_global_references_list()
            {
                this.reference = new BinaryReference
                {
                    Name = "mscorlib",
                    Referrer = "project"
                };

                this.check = new ProjectIntegrityCheck(Mock.Of<IFileSystem>(), ReferenceRegistry.Empty(), "libs");
            }
 public Given_a_reference_with_empty_path_which_is_in_global_references_list()
 {
     this.reference = new BinaryReference { Name = "mscorlib", Path = String.Empty };
     this.check = new ProjectIntegrityCheck(
         Mock.Of<IFileSystem>(), ReferenceRegistry.FromReferenceNames(new[] { "mscorlib" }), "libs");
 }
            public Given_a_reference_with_existing_path_not_in_external_libs_dir()
            {
                this.reference = new BinaryReference
                {
                    Name = "what", 
                    Path = "wrong\\what.dll", 
                    FullPath = "wrong\\what.dll",
                    Referrer = "project"
                };

                this.check = new ProjectIntegrityCheck(
                    new MockFileSystem(new Dictionary<string, MockFileData>
                    {
                        { "wrong\\what.dll", new MockFileData(String.Empty) }
                    }), ReferenceRegistry.Empty(), "libs");
            }
            public Given_a_reference_with_path_which_does_not_exist()
            {
                this.reference = new BinaryReference
                {
                    Name = "what", 
                    Path = "libs\\what.dll",
                    Referrer = "project",
                };

                this.check = new ProjectIntegrityCheck(
                    new MockFileSystem(new Dictionary<string, MockFileData>
                    {
                        { "any.dll", new MockFileData(String.Empty) }
                    }), ReferenceRegistry.Empty(), "libs");
            }