예제 #1
0
        public void TestUnsupportedOSPlatformAttributeWithMessage(string platformName, string?message)
        {
            var tpa = new UnsupportedOSPlatformAttribute(platformName, message);

            Assert.Equal(platformName, tpa.PlatformName);
            Assert.Equal(message, tpa.Message);
        }
예제 #2
0
        public void TranslateUnsupportedOSPlatformAttribute()
        {
            var unsupported = new UnsupportedOSPlatformAttribute("Linux");

            var platform = (PlatformAttribute)OSPlatformTranslator.Translate(new[] { unsupported }).Single();

            Assert.That(platform.Include, Is.Null, nameof(platform.Include));
            Assert.That(platform.Exclude, Is.EqualTo("Linux"), nameof(platform.Exclude));
        }
예제 #3
0
        public void TranslateMixedOSPlatformAttributes()
        {
            var supported1  = new SupportedOSPlatformAttribute("Windows7.0");
            var supported2  = new SupportedOSPlatformAttribute("Linux");
            var unsupported = new UnsupportedOSPlatformAttribute("Android");
            var osPlatforms = new OSPlatformAttribute[] { supported1, unsupported, supported2 };

            object[] attributes = OSPlatformTranslator.Translate(osPlatforms).ToArray();
            Assert.That(attributes, Has.Length.EqualTo(1));
            Assert.That(attributes[0], Is.InstanceOf <PlatformAttribute>());
            var platform = (PlatformAttribute)attributes[0];

            Assert.That(platform.Include, Is.EqualTo("Windows7,Linux"), nameof(platform.Include));
            Assert.That(platform.Exclude, Is.EqualTo("Android"), nameof(platform.Exclude));
        }
예제 #4
0
        public void TestUnsupportedOSPlatformAttribute(string platformName)
        {
            var tpa = new UnsupportedOSPlatformAttribute(platformName);

            Assert.Equal(platformName, tpa.PlatformName);
        }