diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/Translations/Temporal/DateTimeOffsetTranslationsCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/Translations/Temporal/DateTimeOffsetTranslationsCosmosTest.cs index 7462373cf05..7805083b6ce 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/Translations/Temporal/DateTimeOffsetTranslationsCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/Translations/Temporal/DateTimeOffsetTranslationsCosmosTest.cs @@ -42,6 +42,7 @@ public override async Task Date() AssertSql(); } + [CosmosCondition(CosmosCondition.IsEmulator)] public override async Task Year() { // Our persisted representation of DateTimeOffset (xxx+00:00) isn't supported by Cosmos (should be xxxZ). #35310 @@ -55,6 +56,7 @@ FROM root c """); } + [CosmosCondition(CosmosCondition.IsEmulator)] public override async Task Month() { // Our persisted representation of DateTimeOffset (xxx+00:00) isn't supported by Cosmos (should be xxxZ). #35310 @@ -76,6 +78,7 @@ public override async Task DayOfYear() AssertSql(); } + [CosmosCondition(CosmosCondition.IsEmulator)] public override async Task Day() { // Our persisted representation of DateTimeOffset (xxx+00:00) isn't supported by Cosmos (should be xxxZ). #35310 @@ -89,6 +92,7 @@ FROM root c """); } + [CosmosCondition(CosmosCondition.IsEmulator)] public override async Task Hour() { // Our persisted representation of DateTimeOffset (xxx+00:00) isn't supported by Cosmos (should be xxxZ). #35310 @@ -102,6 +106,7 @@ FROM root c """); } + [CosmosCondition(CosmosCondition.IsEmulator)] public override async Task Minute() { // Our persisted representation of DateTimeOffset (xxx+00:00) isn't supported by Cosmos (should be xxxZ). #35310 @@ -115,6 +120,7 @@ FROM root c """); } + [CosmosCondition(CosmosCondition.IsEmulator)] public override async Task Second() { // Our persisted representation of DateTimeOffset (xxx+00:00) isn't supported by Cosmos (should be xxxZ). #35310 @@ -128,6 +134,7 @@ FROM root c """); } + [CosmosCondition(CosmosCondition.IsEmulator)] public override async Task Millisecond() { // Our persisted representation of DateTimeOffset (xxx+00:00) isn't supported by Cosmos (should be xxxZ). #35310 @@ -141,6 +148,7 @@ FROM root c """); } + [CosmosCondition(CosmosCondition.IsEmulator)] public override async Task Microsecond() { // Our persisted representation of DateTimeOffset (xxx+00:00) isn't supported by Cosmos (should be xxxZ). #35310 diff --git a/test/EFCore.Cosmos.FunctionalTests/Update/CosmosBulkWarningTest.cs b/test/EFCore.Cosmos.FunctionalTests/Update/CosmosBulkWarningTest.cs index 73d124e67a1..b4ddb9b910b 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Update/CosmosBulkWarningTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Update/CosmosBulkWarningTest.cs @@ -15,7 +15,7 @@ public virtual async Task AutoTransactionBehaviorNever_DoesNotThrow() using var context = fixture.CreateContext(); context.Database.AutoTransactionBehavior = AutoTransactionBehavior.Never; - context.AddRange(Enumerable.Range(0, 200).Select(x => new Customer())); + context.AddRange(Enumerable.Range(0, 100).Select(x => new Customer())); await context.SaveChangesAsync(); } @@ -27,7 +27,7 @@ public virtual async Task AutoTransactionBehaviorWhenNeeded_Throws() context.AddRange(Enumerable.Range(0, 200).Select(x => new Customer())); var ex = await Assert.ThrowsAsync(() => context.SaveChangesAsync()); - Assert.Equal(Message, ex.Message); + Assert.Equal(BulkExecutionWithTransactionalBatchMessage, ex.Message); } [ConditionalFact] @@ -38,10 +38,10 @@ public virtual async Task AutoTransactionBehaviorAlways_Throws() context.AddRange(Enumerable.Range(0, 200).Select(x => new Customer())); var ex = await Assert.ThrowsAsync(() => context.SaveChangesAsync()); - Assert.Equal(Message, ex.Message); + Assert.Equal(BulkExecutionWithTransactionalBatchMessage, ex.Message); } - private string Message => CoreStrings.WarningAsErrorTemplate( + private string BulkExecutionWithTransactionalBatchMessage => CoreStrings.WarningAsErrorTemplate( CosmosEventId.BulkExecutionWithTransactionalBatch.ToString(), CosmosResources.LogBulkExecutionWithTransactionalBatch(new TestLogger()).GenerateMessage(), "CosmosEventId.BulkExecutionWithTransactionalBatch");