Emit\CompilationEmitTests.cs (27)
969[InlineData("public int M() { return 1; }", "public int M() { return 2; }", Match.BothMetadataAndRefOut)]
970[InlineData("public int M() { return 1; }", "public int M() { error(); }", Match.BothMetadataAndRefOut)]
971[InlineData("private void M() { }", "", Match.RefOut)]
972[InlineData("internal void M() { }", "", Match.RefOut)]
973[InlineData("private protected void M() { }", "", Match.RefOut)]
974[InlineData("private void M() { dynamic x = 1; }", "", Match.RefOut)] // no reference added from method bodies
975[InlineData(@"private void M() { var x = new { id = 1 }; }", "", Match.RefOut)]
976[InlineData("private int P { get { Error(); } set { Error(); } }", "", Match.RefOut)] // errors in methods bodies don't matter
977[InlineData("public int P { get; set; }", "", Match.Different)]
978[InlineData("protected int P { get; set; }", "", Match.Different)]
979[InlineData("private int P { get; set; }", "", Match.RefOut)] // private auto-property and underlying field are removed
980[InlineData("internal int P { get; set; }", "", Match.RefOut)]
981[InlineData("private event Action E { add { Error(); } remove { Error(); } }", "", Match.RefOut)]
982[InlineData("internal event Action E { add { Error(); } remove { Error(); } }", "", Match.RefOut)]
983[InlineData("private class C2 { }", "", Match.Different)] // all types are included
984[InlineData("private struct S { }", "", Match.Different)]
985[InlineData("public struct S { private int i; }", "public struct S { }", Match.Different)]
986[InlineData("private int i;", "", Match.RefOut)]
987[InlineData("public C() { }", "", Match.BothMetadataAndRefOut)]
988public void RefAssembly_InvariantToSomeChanges(string left, string right, Match expectedMatch)
1169[InlineData("internal void M() { }", "", Match.Different)]
1170[InlineData("private protected void M() { }", "", Match.Different)]
1171public void RefAssembly_InvariantToSomeChangesWithInternalsVisibleTo(string left, string right, Match expectedMatch)
1197private static void CompareAssemblies(string sourceTemplate, string change1, string change2, Match expectedMatch, bool includePrivateMembers)
1200expectedMatch == Match.BothMetadataAndRefOut :
1201(expectedMatch == Match.BothMetadataAndRefOut || expectedMatch == Match.RefOut);