Skip to content

Commit 0c39437

Browse files
Test characterization
1 parent 174a51a commit 0c39437

3 files changed

Lines changed: 30 additions & 29 deletions

File tree

Tests/CSharp/ExpressionTests/XmlExpressionTests.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,30 @@ private void TestMethod()
120120
3 target compilation errors:
121121
CS0029: Cannot implicitly convert type 'System.Xml.Linq.XElement' to 'System.Xml.Linq.XDocument'
122122
CS1061: 'IEnumerable<XElement>' does not contain a definition for 'Value' and no accessible extension method 'Value' accepting a first argument of type 'IEnumerable<XElement>' could be found (are you missing a using directive or an assembly reference?)
123-
CS0103: The name 'TransformDescription' does not exist in the current context");
123+
CS0103: The name 'TransformDescription' does not exist in the current context",
124+
hasLineCommentConversionIssue: true);
125+
}
126+
127+
128+
129+
[Fact]
130+
public async Task AssignmentStatementWithXmlElementAsync()
131+
{
132+
await TestConversionVisualBasicToCSharpAsync(@"Class TestClass
133+
Private Sub TestMethod()
134+
Dim b = <someXmlTag></someXmlTag>
135+
Dim c = <someXmlTag><bla anAttribute=""itsValue"">tata</bla><someContent>tata</someContent></someXmlTag>
136+
End Sub
137+
End Class", @"using System.Xml.Linq;
138+
139+
internal partial class TestClass
140+
{
141+
private void TestMethod()
142+
{
143+
XElement b = XElement.Parse($@""<someXmlTag> </someXmlTag>"");
144+
XElement c = XElement.Parse($@""<someXmlTag> <bla anAttribute=""""itsValue"""">{""tata""}</bla> <someContent>{""tata""}</someContent> </someXmlTag>"");
145+
}
146+
}");
124147
}
125148
}
126149
}

Tests/CSharp/StatementTests/StatementTests.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,6 @@ private void TestMethod()
123123
}");
124124
}
125125

126-
[Fact]
127-
public async Task AssignmentStatementWithXmlElementAsync()
128-
{
129-
await TestConversionVisualBasicToCSharpAsync(@"Class TestClass
130-
Private Sub TestMethod()
131-
Dim b = <someXmlTag></someXmlTag>
132-
Dim c = <someXmlTag><bla anAttribute=""itsValue"">tata</bla><someContent>tata</someContent></someXmlTag>
133-
End Sub
134-
End Class", @"using System.Xml.Linq;
135-
136-
internal partial class TestClass
137-
{
138-
private void TestMethod()
139-
{
140-
XElement b = XElement.Parse(""<someXmlTag></someXmlTag>"");
141-
XElement c = XElement.Parse(""<someXmlTag><bla anAttribute=\""itsValue\"">tata</bla><someContent>tata</someContent></someXmlTag>"");
142-
}
143-
}");
144-
}
145-
146126
/// <summary>
147127
/// Implicitly typed lambdas exist in vb but are not happening in C#. See discussion on https://github.com/dotnet/roslyn/issues/14
148128
/// * For VB local declarations, inference happens. The closest equivalent in C# is a local function since Func/Action would be overly restrictive for some cases

Tests/CSharp/TriviaTests.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,14 @@ End Sub
139139
public partial class AClass
140140
{
141141
/* TODO ERROR: Skipped IfDirectiveTrivia
142-
#If TRUE
143-
*/
144-
private void AMethod()
145-
{
146-
}
147-
/* TODO ERROR: Skipped EndIfDirectiveTrivia
142+
#If FALSE
143+
*//* TODO ERROR: Skipped DisabledTextTrivia
144+
Private Sub AMethod()
145+
End Sub
146+
*/ /* TODO ERROR: Skipped EndIfDirectiveTrivia
148147
#End If
149148
*/
150-
}
151-
");
149+
}");
152150
}
153151
}
154152
}

0 commit comments

Comments
 (0)