Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwengier committed Jun 27, 2022
1 parent 56487f2 commit a23a806
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,13 @@ public void Property_BlockBodyToExpressionBody2()
var edits = GetTopEdits(src1, src2);
var active = GetActiveStatements(src1, src2);

edits.VerifySemanticDiagnostics(active,
Diagnostic(RudeEditKind.Delete, "int P", DeletedSymbolDisplay(CSharpFeaturesResources.property_setter, "P.set")));
edits.VerifySemantics(
new[]
{
SemanticEdit(SemanticEditKind.Update, c => c.GetMember("C.get_P")),
SemanticEdit(SemanticEditKind.Delete, c => c.GetMember("C.set_P"), deletedSymbolContainerProvider: c => c.GetMember("C")),
},
capabilities: EditAndContinueCapabilities.Baseline);
}

[Fact]
Expand Down Expand Up @@ -688,8 +693,13 @@ public void Indexer_BlockBodyToExpressionBody2()
var edits = GetTopEdits(src1, src2);
var active = GetActiveStatements(src1, src2);

edits.VerifySemanticDiagnostics(active,
Diagnostic(RudeEditKind.Delete, "int this[int a]", DeletedSymbolDisplay(CSharpFeaturesResources.indexer_setter, "this[int a].set")));
edits.VerifySemantics(
new[]
{
SemanticEdit(SemanticEditKind.Update, c => c.GetMember("C.get_Item")),
SemanticEdit(SemanticEditKind.Delete, c => c.GetMember("C.set_Item"), deletedSymbolContainerProvider: c => c.GetMember("C")),
},
capabilities: EditAndContinueCapabilities.Baseline);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2442,8 +2442,14 @@ class C
var edits = GetTopEdits(src1, src2);
var active = GetActiveStatements(src1, src2);

edits.VerifySemanticDiagnostics(active,
Diagnostic(RudeEditKind.Delete, "class C", DeletedSymbolDisplay(FeaturesResources.auto_property, "a")));
edits.VerifySemantics(
new[]
{
SemanticEdit(SemanticEditKind.Insert, c => c.GetMember("C.a")),
SemanticEdit(SemanticEditKind.Delete, c => c.GetMember("C.get_a"), deletedSymbolContainerProvider: c => c.GetMember("C")),
SemanticEdit(SemanticEditKind.Update, c => c.GetMember("C..ctor"), preserveLocalVariables: true),
},
capabilities: EditAndContinueCapabilities.AddInstanceFieldToExistingType);
}

#endregion
Expand Down

0 comments on commit a23a806

Please sign in to comment.