Skip to content

Commit e66216d

Browse files
committed
Added tests for VT.Create
1 parent 0143450 commit e66216d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/ReadabilityRules/SA1141CSharp7UnitTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public static implicit operator (int, int)(TestClass p1)
102102
public async Task ValidateValueTupleObjectCreationAsync()
103103
{
104104
var testCode = @"using System;
105+
using VT = System.ValueTuple;
105106
106107
public class TestClass
107108
{
@@ -114,7 +115,9 @@ public void TestMethod()
114115
var test5 = ([|new ValueTuple<int, int>(3, 4)|], 2);
115116
var test6 = [|new System.ValueTuple<int, System.ValueTuple<int, int>>(1, (2, 3))|];
116117
var test7 = [|ValueTuple.Create|](1, 2);
118+
var test7B = [|VT.Create|](1, 2);
117119
var test8 = [|ValueTuple.Create<int, double>|](1, 2);
120+
var test8B = [|VT.Create<int, double>|](1, 2);
118121
var test9 = [|System.ValueTuple.Create|](1, [|new ValueTuple<int, double>(2, 3)|]);
119122
var test10 = [|ValueTuple.Create|]([|ValueTuple.Create|](1, 2, 3), 4);
120123
var test11 = [|new ValueTuple<int, ValueTuple<int, int>>(1, [|ValueTuple.Create|](2, 3))|];
@@ -124,6 +127,7 @@ public void TestMethod()
124127
";
125128

126129
var fixedCode = @"using System;
130+
using VT = System.ValueTuple;
127131
128132
public class TestClass
129133
{
@@ -136,7 +140,9 @@ public void TestMethod()
136140
var test5 = ((3, 4), 2);
137141
var test6 = (1, (2, 3));
138142
var test7 = (1, 2);
143+
var test7B = (1, 2);
139144
var test8 = (1, (double)2);
145+
var test8B = (1, (double)2);
140146
var test9 = (1, (2, (double)3));
141147
var test10 = ((1, 2, 3), 4);
142148
var test11 = (1, (2, 3));

0 commit comments

Comments
 (0)