Skip to content

Commit 7e85918

Browse files
Fixing .NET 10 compilation warnings
C:\src\v32\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.EmulatorTests\Linq\LinqSQLTranslationBaselineTests.cs(73,16): error CS8981: The type name 'simple' only contains lower-cased ascii characters. Such names may become reserved for the language. C:\src\v32\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.EmulatorTests\Linq\LinqSQLTranslationBaselineTests.cs(84,16): error CS8981: The type name 'nested' only contains lower-cased ascii characters. Such names may become reserved for the language. C:\src\v32\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.EmulatorTests\Linq\LinqSQLTranslationBaselineTests.cs(96,16): error CS8981: The type name 'complex' only contains lower-cased ascii characters. Such names may become reserved for the language.
1 parent d4c91a0 commit 7e85918

10 files changed

Lines changed: 35 additions & 39 deletions

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CustomSerializationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public void TestStoredProcedure()
330330

331331
client.EnsureValidClientAsync(NoOpTrace.Singleton).Wait();
332332

333-
// Create a simple stored procedure
333+
// Create a Simple stored procedure
334334
string scriptId = "bulkImportScript";
335335
StoredProcedure sproc = new StoredProcedure
336336
{

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ ContainerResponse containerResponse
949949
Assert.IsNotNull(throughputProperties);
950950
Assert.AreEqual(expectedThroughput, throughputProperties.Throughput);
951951

952-
// simple API
952+
// Simple API
953953
int? throughput = await container.ReadThroughputAsync();
954954
Assert.IsNotNull(throughput);
955955
Assert.AreEqual(expectedThroughput, throughput);

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqGeneralBaselineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ public void TestSubquery()
674674

675675
// Customer requested scenario
676676
inputs.Add(new LinqTestInput(
677-
"Where(simple expr && Any)", b => getQuery(b)
677+
"Where(Simple expr && Any)", b => getQuery(b)
678678
.Where(f => f.FamilyId.Contains("a") && f.Children.Any(c => c.Pets.Count() > 0))));
679679

680680
inputs.Add(new LinqTestInput(

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqSQLTranslationBaselineTests.cs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,38 +70,38 @@ public async static Task CleanUp()
7070
cosmosClient?.Dispose();
7171
}
7272

73-
struct simple
73+
struct Simple
7474
{
7575
public int x;
7676
public int y;
7777
public string id;
7878
public string pk;
7979

80-
public simple(int x, int y)
80+
public Simple(int x, int y)
8181
{ this.x = x; this.y = y; this.id = Guid.NewGuid().ToString(); this.pk = "Test"; }
8282
}
8383

84-
struct nested
84+
struct Nested
8585
{
8686
public int x;
87-
public simple s;
87+
public Simple s;
8888

89-
public nested(int x, simple s)
89+
public Nested(int x, Simple s)
9090
{
9191
this.x = x;
9292
this.s = s;
9393
}
9494
}
9595

96-
struct complex
96+
struct Complex
9797
{
9898
private string json;
9999

100100
public double dbl;
101101
public string str;
102102
public bool b;
103103
public double[] dblArray;
104-
public simple inside;
104+
public Simple inside;
105105
public string id;
106106
public string pk;
107107

@@ -111,7 +111,7 @@ struct complex
111111
[System.Text.Json.Serialization.JsonExtensionData()]
112112
public Dictionary<string, object> NetExtensionData { get; set; }
113113

114-
public complex(double d, string str, bool b, double[] da, simple s)
114+
public Complex(double d, string str, bool b, double[] da, Simple s)
115115
{
116116
this.dbl = d;
117117
this.str = str;
@@ -127,7 +127,7 @@ public complex(double d, string str, bool b, double[] da, simple s)
127127

128128
public override string ToString()
129129
{
130-
// simple cached serialization
130+
// Simple cached serialization
131131
if (this.json == null)
132132
{
133133
this.json = JsonConvert.SerializeObject(this);
@@ -137,7 +137,7 @@ public override string ToString()
137137

138138
public override bool Equals(object obj)
139139
{
140-
if (!(obj is complex)) return false;
140+
if (!(obj is Complex)) return false;
141141

142142
return this.ToString().Equals(obj.ToString());
143143
}
@@ -207,16 +207,16 @@ public void ValidateSQLTranslation()
207207
float floatValue = 5.23f;
208208

209209
const int Records = 100;
210-
Func<Random, simple> createDataObj = (random) =>
210+
Func<Random, Simple> createDataObj = (random) =>
211211
{
212-
simple obj = new simple();
212+
Simple obj = new Simple();
213213
obj.x = random.Next();
214214
obj.y = random.Next();
215215
obj.id = Guid.NewGuid().ToString();
216216
obj.pk = "Test";
217217
return obj;
218218
};
219-
Func<bool, IQueryable<simple>> dataQuery = LinqTestsCommon.GenerateTestCosmosData<simple>(createDataObj, Records, testContainer);
219+
Func<bool, IQueryable<Simple>> dataQuery = LinqTestsCommon.GenerateTestCosmosData<Simple>(createDataObj, Records, testContainer);
220220

221221
List<LinqTestInput> inputs = new List<LinqTestInput>();
222222
inputs.Add(new LinqTestInput("Select cast float", b => dataQuery(b).Select(x => (int)floatValue)));
@@ -225,7 +225,7 @@ public void ValidateSQLTranslation()
225225
inputs.Add(new LinqTestInput("Select int expr w const", b => dataQuery(b).Select(x => x.x + constInt)));
226226
inputs.Add(new LinqTestInput("Select w new array", b => dataQuery(b).Select(d => new int[2] { d.x, d.x + 1 })));
227227
inputs.Add(new LinqTestInput("Select new", b => dataQuery(b).Select(d => new { first = d.x, second = d.x })));
228-
inputs.Add(new LinqTestInput("Select nested new", b => dataQuery(b).Select(d => new { first = d.x, second = new { third = d.x } })));
228+
inputs.Add(new LinqTestInput("Select Nested new", b => dataQuery(b).Select(d => new { first = d.x, second = new { third = d.x } })));
229229
inputs.Add(new LinqTestInput("Filter int >", b => dataQuery(b).Where(x => x.x > 2)));
230230
inputs.Add(new LinqTestInput("Filter method >", b => dataQuery(b).Where(x => x.x > id(3))));
231231
inputs.Add(new LinqTestInput("Filter int > -> Select int expr", b => dataQuery(b).Where(x => x.x > 2).Select(x => x.x + 2)));
@@ -236,18 +236,18 @@ public void ValidateSQLTranslation()
236236
inputs.Add(new LinqTestInput("Select const array index", b => dataQuery(b)
237237
.Where(x => x.x >= 0 && x.x < 3)
238238
.Select(x => new int[] { 1, 2, 3 }[x.x])));
239-
inputs.Add(new LinqTestInput("Select new simple", b => dataQuery(b).Select(x => new simple { x = x.x, y = x.x })));
240-
inputs.Add(new LinqTestInput("Select new nested", b => dataQuery(b).Select(x => new nested { s = new simple { x = x.x, y = x.x }, x = 2 })));
241-
inputs.Add(new LinqTestInput("Select new complex", b => dataQuery(b).Select(d => new complex { dbl = 1.0, str = "", b = false, dblArray = new double[] { 1.0, 2.0, }, inside = new simple { x = d.x, y = d.x } })));
239+
inputs.Add(new LinqTestInput("Select new Simple", b => dataQuery(b).Select(x => new Simple { x = x.x, y = x.x })));
240+
inputs.Add(new LinqTestInput("Select new Nested", b => dataQuery(b).Select(x => new Nested { s = new Simple { x = x.x, y = x.x }, x = 2 })));
241+
inputs.Add(new LinqTestInput("Select new Complex", b => dataQuery(b).Select(d => new Complex { dbl = 1.0, str = "", b = false, dblArray = new double[] { 1.0, 2.0, }, inside = new Simple { x = d.x, y = d.x } })));
242242
inputs.Add(new LinqTestInput("Select cast double x", b => dataQuery(b).Select(x => (double)x.x)));
243243
inputs.Add(new LinqTestInput("Select indexer x", b => dataQuery(b)
244244
.Where(x => x.x >= 0 && x.x < array.Length)
245245
.Select(x => array[x.x])));
246246
inputs.Add(new LinqTestInput("Select new constructor", b => dataQuery(b).Select(x => new TimeSpan(x.x))));
247247
inputs.Add(new LinqTestInput("Select method id", b => dataQuery(b).Select(x => id(x))));
248248
inputs.Add(new LinqTestInput("Select identity", b => dataQuery(b).Select(x => x)));
249-
inputs.Add(new LinqTestInput("Select simple property", b => dataQuery(b).Select(x => x.x)));
250-
inputs.Add(new LinqTestInput("Select extension data", b => dataQuery(b).Select(x => new complex() {
249+
inputs.Add(new LinqTestInput("Select Simple property", b => dataQuery(b).Select(x => x.x)));
250+
inputs.Add(new LinqTestInput("Select extension data", b => dataQuery(b).Select(x => new Complex() {
251251
NewtonsoftExtensionData = new() {
252252
{ "test", 1.5 }
253253
},
@@ -268,17 +268,17 @@ public void ValidateSQLTranslationComplexData()
268268
const int Records = 100;
269269
const int MaxArraySize = 10;
270270
const int MaxStringLength = 50;
271-
Func<Random, complex> createDataObj = (random) =>
271+
Func<Random, Complex> createDataObj = (random) =>
272272
{
273-
complex obj = new complex();
273+
Complex obj = new Complex();
274274
obj.b = random.NextDouble() < 0.5;
275275
obj.dbl = random.NextDouble();
276276
obj.dblArray = new double[random.Next(MaxArraySize)];
277277
for (int i = 0; i < obj.dblArray.Length; ++i)
278278
{
279279
obj.dblArray[i] = random.NextDouble() < 0.1 ? 3 : random.NextDouble();
280280
}
281-
obj.inside = new simple() { x = random.Next(), y = random.Next() };
281+
obj.inside = new Simple() { x = random.Next(), y = random.Next() };
282282
obj.str = random.NextDouble() < 0.1 ? "5" : LinqTestsCommon.RandomString(random, random.Next(MaxStringLength));
283283
obj.id = Guid.NewGuid().ToString();
284284
obj.pk = "Test";
@@ -288,7 +288,7 @@ public void ValidateSQLTranslationComplexData()
288288
};
289289
return obj;
290290
};
291-
Func<bool, IQueryable<complex>> getQuery = LinqTestsCommon.GenerateTestCosmosData<complex>(createDataObj, Records, testContainer);
291+
Func<bool, IQueryable<Complex>> getQuery = LinqTestsCommon.GenerateTestCosmosData<Complex>(createDataObj, Records, testContainer);
292292

293293
List<LinqTestInput> inputs = new List<LinqTestInput>();
294294
inputs.Add(new LinqTestInput("Select equality", b => getQuery(b).Select(s => s.str == "5")));

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqScalarFunctionBaselineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void TestFirstOrDefault()
156156
/////////////////
157157

158158
// ISSUE-TODO-adityasa-2024/1/26 - Support FirstOrDefault overloads.
159-
// Please note, this requires potential support for user code invocation in context of rest of the client code (except maybe some simple cases).
159+
// Please note, this requires potential support for user code invocation in context of rest of the client code (except maybe some Simple cases).
160160
// We do not currently do this for any other scenarios.
161161

162162
// Unsupported

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestsCommon.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ protected virtual string SerializeForTestBaseline()
636636

637637
public override string ToString()
638638
{
639-
// simple cached serialization
639+
// Simple cached serialization
640640
this.json ??= this.SerializeForTestBaseline();
641641
return this.json;
642642
}

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTranslationBaselineTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ public void TestArrayContainsAll()
14421442
10.123456789d,
14431443
new object[] {
14441444
"world",
1445-
new object[] { "nested array", new { A = int.MaxValue, B = int.MinValue } } })).Select(doc => doc.ArrayField),
1445+
new object[] { "Nested array", new { A = int.MaxValue, B = int.MinValue } } })).Select(doc => doc.ArrayField),
14461446
skipVerification: true,
14471447
serializeOutput: true),
14481448
new LinqTestInput("same field",
@@ -1458,7 +1458,7 @@ public void TestArrayContainsAll()
14581458
10.123456789d,
14591459
new object[] {
14601460
"world",
1461-
new object[] { "nested array", new { A = int.MaxValue, B = int.MinValue } } }
1461+
new object[] { "Nested array", new { A = int.MaxValue, B = int.MinValue } } }
14621462
}.ArrayContainsAll(doc.ArrayField)).Select(doc => doc.ArrayField),
14631463
skipVerification: true,
14641464
serializeOutput: true),
@@ -1588,7 +1588,7 @@ public void TestArrayContainsAny()
15881588
10.123456789d,
15891589
new object[] {
15901590
"world",
1591-
new object[] { "nested array", new { A = int.MaxValue, B = int.MinValue } } })).Select(doc => doc.ArrayField),
1591+
new object[] { "Nested array", new { A = int.MaxValue, B = int.MinValue } } })).Select(doc => doc.ArrayField),
15921592
skipVerification: true,
15931593
serializeOutput: true),
15941594
new LinqTestInput("same field",
@@ -1604,7 +1604,7 @@ public void TestArrayContainsAny()
16041604
10.123456789d,
16051605
new object[] {
16061606
"world",
1607-
new object[] { "nested array", new { A = int.MaxValue, B = int.MinValue } } }
1607+
new object[] { "Nested array", new { A = int.MaxValue, B = int.MinValue } } }
16081608
}.ArrayContainsAny(doc.ArrayField)).Select(doc => doc.ArrayField),
16091609
skipVerification: true,
16101610
serializeOutput: true),

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,16 @@
5454

5555
<ItemGroup>
5656
<PackageReference Include="Azure.Identity" Version="1.11.4" />
57-
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
5857
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
5958
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.7.1" />
6059
<PackageReference Include="OpenTelemetry" Version="1.9.0" />
61-
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
62-
<PackageReference Include="System.Security.SecureString" Version="4.3.0" />
6360
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.0" />
6461
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
6562
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
6663
<PackageReference Include="Moq" Version="4.8.2" />
6764
<PackageReference Include="MSTest.TestAdapter" Version="3.7.3" />
6865
<PackageReference Include="MSTest.TestFramework" Version="3.7.3" />
6966
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
70-
<PackageReference Include="System.Reflection" Version="4.3.0" />
7167
</ItemGroup>
7268

7369
<ItemGroup>

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/ConflictsE2ETest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private async Task InsertWithoutConflict(IReadOnlyList<(CosmosClient Client, Con
125125
/// <summary>
126126
/// Insert documents until exactly one conflict is generated.
127127
/// This is a non-deterministic operation (in terms of both duration and outcome) due to backend's behavior.
128-
/// It will terminate the test based on simple heuristic if desired outcome cannot be achieved.
128+
/// It will terminate the test based on Simple heuristic if desired outcome cannot be achieved.
129129
/// </summary>
130130
private async Task InsertWithConflict(IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers)
131131
=> await this.InsertFromMultipleClients(

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ private async Task TestQueryUnicodeDocument(bool useGateway, Protocol protocol)
849849
}
850850
};
851851

852-
await testDocumentSQL("doc00", "simple", null);
852+
await testDocumentSQL("doc00", "Simple", null);
853853
await testDocumentSQL("doc10", "\uD83D\uDE03", @"\uD83D\uDE03");
854854
await testDocumentSQL("doc20", "\uD83D\uDE03\t\u0005\uD83D\uDE03", @"\uD83D\uDE03\t\u0005\uD83D\uDE03");
855855
await testDocumentSQL("doc30", "Små ord", null);
@@ -2224,7 +2224,7 @@ await TestCommon.AsyncRetryRateLimiting<Document>(async () =>
22242224
});
22252225
}
22262226

2227-
// simple validations - existence - yes & no
2227+
// Simple validations - existence - yes & no
22282228
DocumentFeedResponse<dynamic> result = await this.client.CreateDocumentQuery<Document>(collection, "SELECT r.id FROM root r", new FeedOptions() { EnableCrossPartitionQuery = true }).AsDocumentQuery().ExecuteNextAsync();
22292229
Assert.IsNull(result.ResponseHeaders[WFConstants.BackendHeaders.QueryMetrics], "Expected no metrics headers for query");
22302230
Assert.IsNull(result.ResponseHeaders[WFConstants.BackendHeaders.IndexUtilization], "Expected no index utilization headers for query");

0 commit comments

Comments
 (0)