Skip to content

Commit

Permalink
Fix Cosmos build break. (#22127)
Browse files Browse the repository at this point in the history
The exception message for actual instance has changed from emulator version.
  • Loading branch information
smitpatel authored Aug 19, 2020
1 parent 200360e commit 978370a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
8 changes: 4 additions & 4 deletions test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ public async Task Add_update_delete_query_throws_if_no_container()
context.Add(customer);

Assert.StartsWith(
@"Message: {""Errors"":[""Resource Not Found""]}",
@"Message: {""Errors"":[""Resource Not Found",
(await Assert.ThrowsAsync<HttpException>(() => context.SaveChangesAsync())).Message);
}

Expand All @@ -1230,7 +1230,7 @@ public async Task Add_update_delete_query_throws_if_no_container()
context.Add(customer).State = EntityState.Modified;

Assert.StartsWith(
@"Message: {""Errors"":[""Resource Not Found""]}",
@"Message: {""Errors"":[""Resource Not Found",
(await Assert.ThrowsAsync<HttpException>(() => context.SaveChangesAsync())).Message);
}

Expand All @@ -1239,14 +1239,14 @@ public async Task Add_update_delete_query_throws_if_no_container()
context.Add(customer).State = EntityState.Deleted;

Assert.StartsWith(
@"Message: {""Errors"":[""Resource Not Found""]}",
@"Message: {""Errors"":[""Resource Not Found",
(await Assert.ThrowsAsync<HttpException>(() => context.SaveChangesAsync())).Message);
}

using (var context = new CustomerContext(options))
{
Assert.StartsWith(
@"Message: {""Errors"":[""Resource Not Found""]}",
@"Message: {""Errors"":[""Resource Not Found",
(await Assert.ThrowsAsync<HttpException>(() => context.Set<Customer>().SingleAsync())).Message);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,6 @@ FROM [Orders] AS [o]
LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID]
LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID]
ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID], [o0].[ProductID]");

using var context = CreateContext();

Assert.Equal(
@"SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[Quantity], [o0].[UnitPrice]
FROM [Orders] AS [o]
LEFT JOIN [Customers] AS [c] ON [o].[CustomerID] = [c].[CustomerID]
LEFT JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID]
ORDER BY [o].[OrderID], [c].[CustomerID], [o0].[OrderID], [o0].[ProductID]",
context.Set<Order>().Include(o => o.Customer).Include(o => o.OrderDetails).ToQueryString(),
ignoreLineEndingDifferences: true,
ignoreWhiteSpaceDifferences: true);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.TestModels.Northwind;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;
Expand Down Expand Up @@ -1778,16 +1776,6 @@ FROM [Customers] AS [c]
ORDER BY [c].[CustomerID], [o].[OrderID]");
}

public override Task Include_collection_with_last_no_orderby(bool async)
{
return AssertTranslationFailedWithDetails(
() => AssertLast(
async,
ss => ss.Set<Customer>().Include(c => c.Orders),
entryCount: 8
), RelationalStrings.MissingOrderingInSqlExpression);
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

Expand Down

0 comments on commit 978370a

Please sign in to comment.