diff --git a/.gitignore b/.gitignore index d060a300..e3a38bc3 100644 --- a/.gitignore +++ b/.gitignore @@ -346,3 +346,9 @@ MigrationBackup/ # dotnet tool local install directory .store/ + +# JetBrains Rider on Mac can generate these .DS_Store files on every folder in the repository. +.DS_Store + +# Ignore these from rider too. +.idea/ diff --git a/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs b/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs index b3fa7c32..a2a3ffec 100644 --- a/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs +++ b/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs @@ -229,6 +229,67 @@ public void GetLastErrorNotIncludedInBulkGeneration() Assert.False(this.IsMethodGenerated("GetLastError")); } + /// + /// Verifies that GetCurrentProcess is generated. + /// + [Fact] + public void GetGetCurrentProcessGeneration() + { + this.generator = new Generator(this.metadataStream, DefaultTestGeneratorOptions, this.compilation, this.parseOptions); + Assert.True(this.generator.TryGenerate("GetCurrentProcess", CancellationToken.None)); + this.CollectGeneratedCode(this.generator); + Assert.True(this.IsMethodGenerated("GetCurrentProcess")); + } + + /// + /// Verifies that GetCurrentProcessId is generated. + /// + [Fact] + public void GetGetCurrentProcessIdGeneration() + { + this.generator = new Generator(this.metadataStream, DefaultTestGeneratorOptions, this.compilation, this.parseOptions); + Assert.True(this.generator.TryGenerate("GetCurrentProcessId", CancellationToken.None)); + this.CollectGeneratedCode(this.generator); + Assert.True(this.IsMethodGenerated("GetCurrentProcessId")); + } + + /// + /// Verifies that GetCurrentThreadId is generated. + /// + [Fact] + public void GetGetCurrentThreadIdGeneration() + { + this.generator = new Generator(this.metadataStream, DefaultTestGeneratorOptions, this.compilation, this.parseOptions); + Assert.True(this.generator.TryGenerate("GetCurrentThreadId", CancellationToken.None)); + this.CollectGeneratedCode(this.generator); + Assert.True(this.IsMethodGenerated("GetCurrentThreadId")); + } + + /// + /// Verifies that the MINIDUMP_TYPE enum is generated. + /// + [Fact] + public void GetMINIDUMP_TYPEGeneration() + { + this.generator = new Generator(this.metadataStream, DefaultTestGeneratorOptions, this.compilation, this.parseOptions); + Assert.True(this.generator.TryGenerate("MINIDUMP_TYPE", CancellationToken.None)); + this.CollectGeneratedCode(this.generator); + Assert.True(this.generator.TryGetEnumName("MINIDUMP_TYPE", out string? actualDeclaringEnum)); + Assert.Equal("MINIDUMP_TYPE", actualDeclaringEnum); + } + + /// + /// Verifies that MiniDumpWriteDump is generated. + /// + [Fact] + public void GetMiniDumpWriteDumpGeneration() + { + this.generator = new Generator(this.metadataStream, DefaultTestGeneratorOptions, this.compilation, this.parseOptions); + Assert.True(this.generator.TryGenerate("MiniDumpWriteDump", CancellationToken.None)); + this.CollectGeneratedCode(this.generator); + Assert.True(this.IsMethodGenerated("MiniDumpWriteDump")); + } + [Fact] public void FriendlyOverloadOfCOMInterfaceRemovesParameter() {