提交 2512c966 编写于 作者: C CyrusNajmabadi

Add more tests.

上级 ee04359a
......@@ -2318,6 +2318,8 @@ public void CreateAnonymousType1()
Assert.True(type.IsAnonymousType);
Assert.Equal(1, type.GetMembers().OfType<IPropertySymbol>().Count());
Assert.Equal("<anonymous type: int m1>", type.ToDisplayString());
Assert.All(type.GetMembers().OfType<IPropertySymbol>().Select(p => p.Locations.FirstOrDefault()),
loc => Assert.Equal(loc, Location.None));
}
[Fact()]
......@@ -2352,6 +2354,8 @@ public void CreateAnonymousType2()
Assert.True(type.IsAnonymousType);
Assert.Equal(2, type.GetMembers().OfType<IPropertySymbol>().Count());
Assert.Equal("<anonymous type: int m1, bool m2>", type.ToDisplayString());
Assert.All(type.GetMembers().OfType<IPropertySymbol>().Select(p => p.Locations.FirstOrDefault()),
loc => Assert.Equal(loc, Location.None));
}
#region Script return values
......
......@@ -1340,6 +1340,8 @@ BC2014: the value '_' is invalid for option 'RootNamespace'
Assert.True(type.IsAnonymousType)
Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count())
Assert.Equal("<anonymous type: m1 As Integer, m2 As Integer>", type.ToDisplayString())
Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()),
Sub(loc) Assert.Equal(loc, Location.None))
End Sub
<Fact>
......@@ -1385,6 +1387,8 @@ BC2014: the value '_' is invalid for option 'RootNamespace'
Assert.True(type.IsAnonymousType)
Assert.Equal(1, type.GetMembers().OfType(Of IPropertySymbol).Count())
Assert.Equal("<anonymous type: Key m1 As Integer>", type.ToDisplayString())
Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()),
Sub(loc) Assert.Equal(loc, Location.None))
End Sub
<Fact()>
......@@ -1398,6 +1402,8 @@ BC2014: the value '_' is invalid for option 'RootNamespace'
Assert.True(type.IsAnonymousType)
Assert.Equal(1, type.GetMembers().OfType(Of IPropertySymbol).Count())
Assert.Equal("<anonymous type: m1 As Integer>", type.ToDisplayString())
Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()),
Sub(loc) Assert.Equal(loc, Location.None))
End Sub
<Fact()>
......@@ -1410,6 +1416,8 @@ BC2014: the value '_' is invalid for option 'RootNamespace'
Assert.True(type.IsAnonymousType)
Assert.Equal(2, type.GetMembers().OfType(Of IPropertySymbol).Count())
Assert.Equal("<anonymous type: Key m1 As Integer, Key m2 As Boolean>", type.ToDisplayString())
Assert.All(type.GetMembers().OfType(Of IPropertySymbol)().Select(Function(p) p.Locations.FirstOrDefault()),
Sub(loc) Assert.Equal(loc, Location.None))
End Sub
<Fact()>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册