コード例 #1
0
        public static void Main()
        {
            var framework = Assembly
                            .GetEntryAssembly()?
                            .GetCustomAttribute <TargetFrameworkAttribute>()?
                            .FrameworkName;

            var procArch = Environment.Is64BitProcess ? "X64" : "X86";
            var osArch   = Environment.Is64BitOperatingSystem ? "X64" : "X86";

#if NETCORE2
            Console.Title = $"MonoStream {RI.FrameworkDescription}";
            Console.WriteLine($"Framework: {framework} ({RI.FrameworkDescription}) CLR: {RE.GetSystemVersion()}");
            Console.WriteLine($"OS: {Environment.OSVersion} ({RI.OSDescription.Trim()}) {procArch} {RI.OSArchitecture} {RI.ProcessArchitecture}");
#else
            Console.WriteLine($"Framework: {framework} CLR: {Environment.Version}");
            Console.WriteLine($"OS: {Environment.OSVersion} {procArch} {osArch}");
#endif
            Console.WriteLine();

            helloWorldZippedBytes = Convert.FromBase64String(helloWorldZippedBase64);

            defaultColor = Console.ForegroundColor;

            test(ms => new System.IO.Compression.GZipStream(ms, System.IO.Compression.CompressionMode.Decompress));
            test(ms => new ICSharpCode.SharpZipLib.GZip.GZipInputStream(ms));

#if !CI_BUILD
            Console.Write("Press any key to exit...");
            Console.ReadKey();
#endif
        }
コード例 #2
0
 public void FromGlobalAccessCache_nNvoke_ReturnsFalse()
 {
     Assert.False(RuntimeEnvironment.FromGlobalAccessCache(typeof(RuntimeEnvironmentTests).Assembly));
     Assert.False(RuntimeEnvironment.FromGlobalAccessCache(null));
 }
コード例 #3
0
 public void GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException()
 {
     Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid.Empty, Guid.Empty));
 }
コード例 #4
0
 public void RuntimeEnvironmentSysVersion()
 {
     Assert.NotEmpty(RuntimeEnvironment.GetSystemVersion());
 }
コード例 #5
0
 public void RuntimeEnvironmentRuntimeDirectory()
 {
     Assert.True(Directory.Exists(RuntimeEnvironment.GetRuntimeDirectory()));
 }
コード例 #6
0
        public void GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException()
        {
#pragma warning disable 618 // GetRuntimeInterfaceAsIntPtr is marked as Obsolete
            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid.Empty, Guid.Empty));
#pragma warning restore 618
        }