コード例 #1
0
        public void FrameworkReference_FrameworkNameIsCaseInsensitive()
        {
            var frameworkReference1 = new FrameworkReference("Microsoft");
            var frameworkReference2 = new FrameworkReference("microSoft");

            Assert.Equal(frameworkReference1, frameworkReference2);
        }
コード例 #2
0
        public void FrameworkReference_EqualObjectsHaveSameHashCode()
        {
            var frameworkReference1 = new FrameworkReference("Microsoft");
            var frameworkReference2 = new FrameworkReference("microSoft");

            Assert.Equal(frameworkReference1, frameworkReference2);
            Assert.Equal(frameworkReference1.GetHashCode(), frameworkReference2.GetHashCode());
        }
コード例 #3
0
        public void FrameworkReferenceGroup_EqualsAndHashCode_AccountForTargetFramework()
        {
            var frameworkReference1 = new FrameworkReference("ASPNET");
            var frameworkReference2 = new FrameworkReference("WPF");

            var frameworkReferenceGroup1 = new FrameworkReferenceGroup(CommonFrameworks.NetCoreApp30, new FrameworkReference[] { frameworkReference1, frameworkReference2 });
            var frameworkReferenceGroup2 = new FrameworkReferenceGroup(CommonFrameworks.NetCoreApp22, new FrameworkReference[] { frameworkReference1, frameworkReference2 });

            Assert.NotEqual(frameworkReferenceGroup1, frameworkReferenceGroup2);
            Assert.NotEqual(frameworkReferenceGroup1.GetHashCode(), frameworkReferenceGroup2.GetHashCode());
        }
 private static XElement GetXElementFromFrameworkReference(XNamespace ns, FrameworkReference frameworkReference)
 {
     return(new XElement(ns + NuspecUtility.FrameworkReference, new XAttribute(NuspecUtility.Name, frameworkReference.Name)));
 }
コード例 #5
0
 public FrameworkReferenceNode(FrameworkReference reference)
 {
     this.reference = reference;
     referenceName  = reference.Include;
 }