Example #1
0
        internal static IEnumerable <string> GetSkipTraits(IEnumerable <string> additionalFilters = null)
        {
            yield return($"{DeviceType}={DeviceTypes.ToExclude}");

            yield return($"{InteractionType}={InteractionTypes.ToExclude}");

            yield return($"{UI}={FeatureSupport.ToExclude(false)}");

            yield return($"{Hardware.Accelerometer}={FeatureSupport.ToExclude(HardwareSupport.HasAccelerometer)}");

            yield return($"{Hardware.Compass}={FeatureSupport.ToExclude(HardwareSupport.HasCompass)}");

            yield return($"{Hardware.Gyroscope}={FeatureSupport.ToExclude(HardwareSupport.HasGyroscope)}");

            yield return($"{Hardware.Magnetometer}={FeatureSupport.ToExclude(HardwareSupport.HasMagnetometer)}");

            yield return($"{Hardware.Battery}={FeatureSupport.ToExclude(HardwareSupport.HasBattery)}");

            yield return($"{Hardware.Flash}={FeatureSupport.ToExclude(HardwareSupport.HasFlash)}");

            if (additionalFilters != null)
            {
                foreach (var filter in additionalFilters)
                {
                    yield return(filter);
                }
            }
        }
Example #2
0
        internal static List <XUnitFilter> GetCommonTraits(params XUnitFilter[] additionalFilters)
        {
            var filters = new List <XUnitFilter>
            {
                new XUnitFilter(DeviceType, DeviceTypes.ToExclude, true),
                new XUnitFilter(InteractionType, InteractionTypes.ToExclude, true),
                new XUnitFilter(Hardware.Accelerometer, FeatureSupport.ToExclude(HardwareSupport.HasAccelerometer), true),
                new XUnitFilter(Hardware.Compass, FeatureSupport.ToExclude(HardwareSupport.HasCompass), true),
                new XUnitFilter(Hardware.Gyroscope, FeatureSupport.ToExclude(HardwareSupport.HasGyroscope), true),
                new XUnitFilter(Hardware.Magnetometer, FeatureSupport.ToExclude(HardwareSupport.HasMagnetometer), true),
                new XUnitFilter(Hardware.Battery, FeatureSupport.ToExclude(HardwareSupport.HasBattery), true),
                new XUnitFilter(Hardware.Flash, FeatureSupport.ToExclude(HardwareSupport.HasFlash), true),
            };

            if (additionalFilters != null && additionalFilters.Any())
            {
                filters.AddRange(additionalFilters);
            }

            return(filters);
        }