Exemplo n.º 1
0
        public void ReferenceExists_ReferenceNamePassedIsInProjectAndIsReferenceNameWithNoFileExtension_ReturnsTrue()
        {
            CreateTestProject();
            ProjectHelper.AddGacReference(project, "System.ComponentModel.Composition");
            CreateProjectSystem(project);
            string referenceName = "System.ComponentModel.Composition";

            bool result = projectSystem.ReferenceExists(referenceName);

            Assert.IsTrue(result);
        }
Exemplo n.º 2
0
        public void ReferenceExists_ReferenceIsInProjectButIncludesAssemblyVersion_ReturnsTrue()
        {
            CreateTestProject();
            string include = "MyAssembly, Version=0.1.0.0, Culture=neutral, PublicKeyToken=8cc8392e8503e009";

            ProjectHelper.AddGacReference(project, include);
            CreateProjectSystem(project);
            string fileName = @"D:\Projects\Test\myassembly.dll".ToNativePath();

            bool result = projectSystem.ReferenceExists(fileName);

            Assert.IsTrue(result);
        }
Exemplo n.º 3
0
        public void RemoveReference_ReferenceBeingRemovedHasFileExtensionAndProjectHasReferenceIncludingAssemblyVersion_ReferenceRemovedFromProject()
        {
            CreateTestProject();
            string include = "nunit.framework, Version=2.6.2.0, Culture=neutral, PublicKeyToken=8cc8392e8503e009";

            ProjectHelper.AddGacReference(project, include);
            CreateProjectSystem(project);
            string fileName = @"d:\projects\packages\nunit\nunit.framework.dll".ToNativePath();

            projectSystem.RemoveReference(fileName);

            ProjectReference referenceItem = ProjectHelper.GetReference(project, "nunit.framework");

            Assert.IsNull(referenceItem);
        }