public async Task TestFixAllInSolution_DifferentAssemblyWithSameTypeName() { var fixAllActionEquivalenceKey = ImplementInterfaceCodeAction.GetCodeActionEquivalenceKey("Assembly1", "global::I2", explicitly: true, abstractly: false, throughMember: null, codeActionTypeName: typeof(ImplementInterfaceCodeAction).FullName); var input = @" <Workspace> <Project Language=""C#"" AssemblyName=""Assembly1"" CommonReferences=""true""> <Document> public interface I1 { void F1(); } public interface I2 { void F1(); } class B1 : I1, {|FixAllInSolution:I2|} { class C1 : I1, I2 { } } </Document> <Document> class B2 : I1, I2 { class C2 : I1, I2 { } } </Document> </Project> <Project Language=""C#"" AssemblyName=""Assembly2"" CommonReferences=""true""> <Document> public interface I1 { void F1(); } public interface I2 { void F1(); } class B3 : I1, I2 { class C3 : I1, I2 { } } </Document> </Project> </Workspace>"; var expected = @" <Workspace> <Project Language=""C#"" AssemblyName=""Assembly1"" CommonReferences=""true""> <Document> using System; public interface I1 { void F1(); } public interface I2 { void F1(); } class B1 : I1, I2 { void I2.F1() { throw new NotImplementedException(); } class C1 : I1, I2 { void I2.F1() { throw new NotImplementedException(); } } } </Document> <Document> using System; class B2 : I1, I2 { void I2.F1() { throw new NotImplementedException(); } class C2 : I1, I2 { void I2.F1() { throw new NotImplementedException(); } } } </Document> </Project> <Project Language=""C#"" AssemblyName=""Assembly2"" CommonReferences=""true""> <Document> public interface I1 { void F1(); } public interface I2 { void F1(); } class B3 : I1, I2 { class C3 : I1, I2 { } } </Document> </Project> </Workspace>"; await TestAsync(input, expected, compareTokens : false, fixAllActionEquivalenceKey : fixAllActionEquivalenceKey); }
public void TestFixAllInDocument() { var fixAllActionEquivalenceKey = ImplementInterfaceCodeAction.GetCodeActionEquivalenceKey("Assembly1", "global::I1", explicitly: false, abstractly: false, throughMember: null, codeActionTypeName: typeof(ImplementInterfaceCodeAction).FullName); var input = @" <Workspace> <Project Language=""C#"" AssemblyName=""Assembly1"" CommonReferences=""true""> <Document> public interface I1 { void F1(); } public interface I2 { void F1(); } class B1 : {|FixAllInDocument:I1|}, I2 { class C1 : I1, I2 { } } </Document> <Document> class B2 : I1, I2 { class C2 : I1, I2 { } } </Document> </Project> <Project Language=""C#"" AssemblyName=""Assembly2"" CommonReferences=""true""> <ProjectReference>Assembly1</ProjectReference> <Document> class B3 : I1, I2 { class C3 : I1, I2 { } } </Document> </Project> </Workspace>"; var expected = @" <Workspace> <Project Language=""C#"" AssemblyName=""Assembly1"" CommonReferences=""true""> <Document> using System; public interface I1 { void F1(); } public interface I2 { void F1(); } class B1 : I1, I2 { public void F1() { throw new NotImplementedException(); } class C1 : I1, I2 { public void F1() { throw new NotImplementedException(); } } } </Document> <Document> class B2 : I1, I2 { class C2 : I1, I2 { } } </Document> </Project> <Project Language=""C#"" AssemblyName=""Assembly2"" CommonReferences=""true""> <ProjectReference>Assembly1</ProjectReference> <Document> class B3 : I1, I2 { class C3 : I1, I2 { } } </Document> </Project> </Workspace>"; Test(input, expected, compareTokens: false, fixAllActionEquivalenceKey: fixAllActionEquivalenceKey); }