Пример #1
0
        public static bool EnsureStarted()
        {
            var(code, output) = StorageEmulatorHelper.Status();
            if (output.IndexOf("IsRunning: True") > 0)
            {
                return(true);
            }

            (code, output) = StorageEmulatorHelper.StartStorageEmulator();
            return(output.IndexOf("started") > 0);
        }
        public bool CheckEmulator()
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                var(code, output) = StorageEmulatorHelper.Status();
                if (output.IndexOf("IsRunning: True") > 0)
                {
                    return(true);
                }

                (code, output) = StorageEmulatorHelper.StartStorageEmulator();
                return(output.IndexOf("started") > 0);
            }

            Assert.Inconclusive("This test requires Azure Storage Emulator to run");
            return(false);
        }
Пример #3
0
        public static bool CheckEmulator()
        {
            if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_NAME")))
            {
                return(false);
            }

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                var(code, output) = StorageEmulatorHelper.Status();
                if (output.IndexOf("IsRunning: True") > 0)
                {
                    return(true);
                }

                (code, output) = StorageEmulatorHelper.StartStorageEmulator();
                return(output.IndexOf("started") > 0);
            }

            return(false);
        }
Пример #4
0
        public static bool CheckEmulator()
        {
            if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_NAME")))
            {
                Assert.Inconclusive("This test requires Azure Storage Emulator to run and is disabled on the build server.");
                return(false);
            }

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                var(code, output) = StorageEmulatorHelper.Status();
                if (output.IndexOf("IsRunning: True") > 0)
                {
                    return(true);
                }

                (code, output) = StorageEmulatorHelper.StartStorageEmulator();
                return(output.IndexOf("started") > 0);
            }

            Assert.Inconclusive("This test requires Azure Storage Emulator to run");
            return(false);
        }