Beispiel #1
0
        public void PackageSpecificWanringProperties_AddsValueWithGlobalTFM()
        {
            // Arrange
            var code       = NuGetLogCode.NU1500;
            var libraryId  = "test_libraryId";
            var properties = new PackageSpecificWarningProperties();

            properties.Add(code, libraryId);

            // Assert
            Assert.False(properties.Contains(code, libraryId, NuGetFramework.Parse("random_target_graph")));
            Assert.True(properties.Contains(code, libraryId));
        }
Beispiel #2
0
        public void PackageSpecificWanringProperties_DefaultValue()
        {
            // Arrange
            var properties = new PackageSpecificWarningProperties();

            // Assert
            Assert.False(properties.Contains(NuGetLogCode.NU1500, "test_libraryId"));
        }
Beispiel #3
0
        public void PackageSpecificWanringProperties_AddsRangeValueWithGlobalTFM()
        {
            // Arrange
            var codes = new List <NuGetLogCode> {
                NuGetLogCode.NU1500, NuGetLogCode.NU1601, NuGetLogCode.NU1701
            };
            var libraryId  = "test_libraryId";
            var properties = new PackageSpecificWarningProperties();

            properties.AddRange(codes, libraryId);

            // Assert
            foreach (var code in codes)
            {
                Assert.False(properties.Contains(code, libraryId, NuGetFramework.Parse("random_target_graph")));
                Assert.True(properties.Contains(code, libraryId));
            }
        }
        public void PackageSpecificWarningProperties_DefaultValue()
        {
            // Arrange
            var properties      = new PackageSpecificWarningProperties();
            var libraryId       = "test_libraryId";
            var targetFramework = NuGetFramework.Parse("net45");

            // Assert
            Assert.False(properties.Contains(NuGetLogCode.NU1500, libraryId, targetFramework));
        }