Repository: dotnet/roslyn
File: src/Compilers/CSharp/Test/Emit2/PDB/CheckSumTest.cs (C#)

Code before:
    {
        private static CSharpCompilation CreateCompilationWithChecksums(string source, string filePath, string baseDirectory)
        {
            return CSharpCompilation.Create(
                GetUniqueName(),
                new[] { Parse(source, filePath) },
                new[] { MscorlibRef },
                TestOptions.DebugDll.WithSourceReferenceResolver(new SourceFileResolver(ImmutableArray.Create<string>(), baseDirectory)));
        }

        [Fact]
        public void ChecksumAlgorithms()
        {
            var source1 = "public class C1 { public C1() { } }";
            var source256 = "public class C256 { public C256() { } }";
            var source384 = "public class C384 { public C384() { } }";
            var source512 = "public class C512 { public C512() { } }";
            var tree1 = SyntaxFactory.ParseSyntaxTree(StringText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), path: "sha1.cs");
            var tree256 = SyntaxFactory.ParseSyntaxTree(StringText.From(source256, Encoding.UTF8, SourceHashAlgorithm.Sha256), path: "sha256.cs");
            var tree384 = SyntaxFactory.ParseSyntaxTree(StringText.From(source384, Encoding.UTF8, SourceHashAlgorithm.Sha384), path: "sha384.cs");
            var tree512 = SyntaxFactory.ParseSyntaxTree(StringText.From(source512, Encoding.UTF8, SourceHashAlgorithm.Sha512), path: "sha512.cs");

            var compilation = CreateCompilation(new[] { tree1, tree256, tree384, tree512 });

            // The checksumAlgorithm values for SHA-384 and SHA-512 below use raw GUIDs instead of friendly
            // names (like "SHA384"/"SHA512") because SRM's PdbToXmlConverter doesn't yet recognize these GUIDs.
            // Update the expected output to use friendly names once SRM is updated.
            compilation.VerifyPdb(@"
<symbols>
  <files>
    <file id=""1"" name=""sha1.cs"" language=""C#"" checksumAlgorithm=""SHA1"" checksum=""8E-37-F3-94-ED-18-24-3F-35-EC-1B-70-25-29-42-1C-B0-84-9B-C8"" />
    <file id=""2"" name=""sha256.cs"" language=""C#"" checksumAlgorithm=""SHA256"" checksum=""83-31-5B-52-08-2D-68-54-14-88-0E-E3-3A-5E-B7-83-86-53-83-B4-5A-3F-36-9E-5F-1B-60-33-27-0A-8A-EC"" />
    <file id=""3"" name=""sha384.cs"" language=""C#"" checksumAlgorithm=""d99cfeb1-8c43-444a-8a6c-b61269d2a0bf"" checksum=""DC-4F-64-F5-55-33-D6-A0-CF-B6-80-26-E6-CA-EC-3A-F4-64-A8-14-08-63-2D-66-5D-85-70-FF-59-8D-76-09-C7-9A-7D-80-0B-E5-71-34-99-3B-B8-B2-47-9F-91-F7"" />
    <file id=""4"" name=""sha512.cs"" language=""C#"" checksumAlgorithm=""ef2d1afc-6550-46d6-b14b-d70afe9a5566"" checksum=""07-7E-FF-0C-1E-84-35-85-D8-FE-84-A5-13-A8-79-C8-A4-15-C8-A1-EF-6F-3B-04-A8-B2-D2-12-B4-8B-F3-E2-7A-6A-C3-3F-0C-2C-97-B6-16-38-A6-F8-C8-E5-94-E7-23-21-F1-20-9C-4E-BE-3A-A7-53-E4-32-87-EA-D7-3C"" />
  </files>
  <methods>
    <method containingType=""C1"" name="".ctor"">
      <customDebugInfo>
        <using>
          <namespace usingCount=""0"" />
        </using>
      </customDebugInfo>
      <sequencePoints>
        <entry offset=""0x0"" startLine=""1"" startColumn=""19"" endLine=""1"" endColumn=""30"" document=""1"" />
        <entry offset=""0x6"" startLine=""1"" startColumn=""33"" endLine=""1"" endColumn=""34"" document=""1"" />
      </sequencePoints>
    </method>
    <method containingType=""C256"" name="".ctor"">
      <customDebugInfo>
        <forward declaringType=""C1"" methodName="".ctor"" />
      </customDebugInfo>

Review comment (suggestion):
This will fix it: https://github.com/dotnet/symreader-converter/pull/326. Let's wait for the new package, should be available shortly. #Closed

Code after:
    {
        private static CSharpCompilation CreateCompilationWithChecksums(string source, string filePath, string baseDirectory)
        {
            return CSharpCompilation.Create(
                GetUniqueName(),
                new[] { Parse(source, filePath) },
                new[] { MscorlibRef },
                TestOptions.DebugDll.WithSourceReferenceResolver(new SourceFileResolver(ImmutableArray.Create<string>(), baseDirectory)));
        }

        [Fact]
        public void ChecksumAlgorithms()
        {
            var source1 = "public class C1 { public C1() { } }";
            var source256 = "public class C256 { public C256() { } }";
            var source384 = "public class C384 { public C384() { } }";
            var source512 = "public class C512 { public C512() { } }";
            var tree1 = SyntaxFactory.ParseSyntaxTree(StringText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), path: "sha1.cs");
            var tree256 = SyntaxFactory.ParseSyntaxTree(StringText.From(source256, Encoding.UTF8, SourceHashAlgorithm.Sha256), path: "sha256.cs");
            var tree384 = SyntaxFactory.ParseSyntaxTree(StringText.From(source384, Encoding.UTF8, SourceHashAlgorithm.Sha384), path: "sha384.cs");
            var tree512 = SyntaxFactory.ParseSyntaxTree(StringText.From(source512, Encoding.UTF8, SourceHashAlgorithm.Sha512), path: "sha512.cs");

            var compilation = CreateCompilation(new[] { tree1, tree256, tree384, tree512 });

            compilation.VerifyPdb(@"
<symbols>
  <files>
    <file id=""1"" name=""sha1.cs"" language=""C#"" checksumAlgorithm=""SHA1"" checksum=""8E-37-F3-94-ED-18-24-3F-35-EC-1B-70-25-29-42-1C-B0-84-9B-C8"" />
    <file id=""2"" name=""sha256.cs"" language=""C#"" checksumAlgorithm=""SHA256"" checksum=""83-31-5B-52-08-2D-68-54-14-88-0E-E3-3A-5E-B7-83-86-53-83-B4-5A-3F-36-9E-5F-1B-60-33-27-0A-8A-EC"" />
    <file id=""3"" name=""sha384.cs"" language=""C#"" checksumAlgorithm=""SHA384"" checksum=""DC-4F-64-F5-55-33-D6-A0-CF-B6-80-26-E6-CA-EC-3A-F4-64-A8-14-08-63-2D-66-5D-85-70-FF-59-8D-76-09-C7-9A-7D-80-0B-E5-71-34-99-3B-B8-B2-47-9F-91-F7"" />
    <file id=""4"" name=""sha512.cs"" language=""C#"" checksumAlgorithm=""SHA512"" checksum=""07-7E-FF-0C-1E-84-35-85-D8-FE-84-A5-13-A8-79-C8-A4-15-C8-A1-EF-6F-3B-04-A8-B2-D2-12-B4-8B-F3-E2-7A-6A-C3-3F-0C-2C-97-B6-16-38-A6-F8-C8-E5-94-E7-23-21-F1-20-9C-4E-BE-3A-A7-53-E4-32-87-EA-D7-3C"" />
  </files>
  <methods>
    <method containingType=""C1"" name="".ctor"">
      <customDebugInfo>
        <using>
          <namespace usingCount=""0"" />
        </using>
      </customDebugInfo>
      <sequencePoints>
        <entry offset=""0x0"" startLine=""1"" startColumn=""19"" endLine=""1"" endColumn=""30"" document=""1"" />
        <entry offset=""0x6"" startLine=""1"" startColumn=""33"" endLine=""1"" endColumn=""34"" document=""1"" />
      </sequencePoints>
    </method>
    <method containingType=""C256"" name="".ctor"">
      <customDebugInfo>
        <forward declaringType=""C1"" methodName="".ctor"" />
      </customDebugInfo>
      <sequencePoints>
        <entry offset=""0x0"" startLine=""1"" startColumn=""21"" endLine=""1"" endColumn=""34"" document=""2"" />
        <entry offset=""0x6"" startLine=""1"" startColumn=""37"" endLine=""1"" endColumn=""38"" document=""2"" />