System.Tests.EnvironmentTests.GetFolderPath_Windows C# (CSharp) Method

GetFolderPath_Windows() private method

private GetFolderPath_Windows ( Environment folder ) : void
folder Environment
return void
        public unsafe void GetFolderPath_Windows(Environment.SpecialFolder folder)
        {
            string knownFolder = Environment.GetFolderPath(folder);
            Assert.NotEmpty(knownFolder);

            // Call the older folder API to compare our results.
            char* buffer = stackalloc char[260];
            SHGetFolderPathW(IntPtr.Zero, (int)folder, IntPtr.Zero, 0, buffer);
            string folderPath = new string(buffer);
            Assert.Equal(folderPath, knownFolder);
        }