Ejemplo n.º 1
0
        public static bool IsRunningOn(AssertedPlatform assertedPlatform)
        {
            SystemReader systemReader = SystemReader.getInstance();

            bool isRunningOnUnknownOS = (systemReader.getOperatingSystem() == PlatformType.Unknown);

            if (isRunningOnUnknownOS)
            {
                return(false);
            }


            bool isRunningOnWindows = (systemReader.getOperatingSystem() == PlatformType.Windows);

            if (isRunningOnWindows && assertedPlatform == AssertedPlatform.Windows)
            {
                return(true);
            }

            if (!isRunningOnWindows && assertedPlatform == AssertedPlatform.Mono)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        public static void IgnoreOn(AssertedPlatform assertedPlatform, Action codeBlock, string ignoreExplaination)
        {
            if (IsRunningOn(assertedPlatform))
            {
                Assert.Ignore(ignoreExplaination);
                return;
            }

            codeBlock();
        }