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