Ejemplo n.º 1
0
        public void TranslateSupportedOSPlatformAttribute()
        {
            var supported = new SupportedOSPlatformAttribute("Windows7.0");

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

            Assert.That(platform.Include, Is.EqualTo("Windows7"), nameof(platform.Include));
            Assert.That(platform.Exclude, Is.Null, nameof(platform.Exclude));
        }
Ejemplo n.º 2
0
        public void TranslateMultipleOSPlatformAttributes()
        {
            var supported1  = new SupportedOSPlatformAttribute("Windows7.0");
            var supported2  = new SupportedOSPlatformAttribute("Linux");
            var osPlatforms = new OSPlatformAttribute[] { supported1, 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.Null, nameof(platform.Exclude));
        }
Ejemplo n.º 3
0
        public void TranslateMixedPlatformAndOSPlatformAttributes()
        {
            var supported1       = new SupportedOSPlatformAttribute("Windows");
            var supported2       = new SupportedOSPlatformAttribute("Windows10");
            var sourcePlatform   = new PlatformAttribute("Win");
            var sourceAttributes = new object[] { supported1, supported2, sourcePlatform };

            object[] attributes = OSPlatformTranslator.Translate(sourceAttributes).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("Win,Windows10"), nameof(platform.Include));
            Assert.That(platform.Exclude, Is.Null, nameof(platform.Exclude));
        }
Ejemplo n.º 4
0
        public void TestSupportedOSPlatformAttribute(string platformName)
        {
            var tpa = new SupportedOSPlatformAttribute(platformName);

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