Switching to NuGet Ardalis.Specifications (#389)

- updating to use Ardalis.Specifications package as it is maintained and has a more robust implementation
- Removing all custom specification implementation
- Updating unit tests
This commit is contained in:
Eric Fleming
2020-06-08 13:31:22 -04:00
committed by GitHub
parent 1b5b12ec11
commit 70a919e145
28 changed files with 45 additions and 310 deletions

View File

@@ -1,4 +1,4 @@
using Microsoft.eShopWeb.ApplicationCore.Helpers.Query;
using Ardalis.Specification.QueryExtensions.Include;
using Xunit;
namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query.IncludeAggregatorTests

View File

@@ -1,4 +1,4 @@
using Microsoft.eShopWeb.ApplicationCore.Helpers.Query;
using Ardalis.Specification.QueryExtensions.Include;
using Microsoft.eShopWeb.UnitTests.Builders;
using Xunit;

View File

@@ -1,4 +1,4 @@
using Microsoft.eShopWeb.ApplicationCore.Helpers.Query;
using Ardalis.Specification.QueryExtensions.Include;
using Microsoft.eShopWeb.UnitTests.Builders;
using System.Linq;
using Xunit;

View File

@@ -1,4 +1,4 @@
using Microsoft.eShopWeb.ApplicationCore.Helpers.Query;
using Ardalis.Specification.QueryExtensions.Include;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

View File

@@ -19,7 +19,7 @@ namespace Microsoft.eShopWeb.UnitTests
var result = GetTestBasketCollection()
.AsQueryable()
.FirstOrDefault(spec.Criteria);
.FirstOrDefault(spec.Criterias.FirstOrDefault());
Assert.NotNull(result);
Assert.Equal(_testBasketId, result.Id);
@@ -34,7 +34,7 @@ namespace Microsoft.eShopWeb.UnitTests
Assert.False(GetTestBasketCollection()
.AsQueryable()
.Any(spec.Criteria));
.Any(spec.Criterias.FirstOrDefault()));
}
public List<Basket> GetTestBasketCollection()

View File

@@ -3,7 +3,6 @@ using Microsoft.eShopWeb.ApplicationCore.Entities;
using System.Collections.Generic;
using System.Linq;
using Xunit;
using Moq;
namespace Microsoft.eShopWeb.UnitTests
{
@@ -23,7 +22,7 @@ namespace Microsoft.eShopWeb.UnitTests
var result = GetTestItemCollection()
.AsQueryable()
.Where(spec.Criteria);
.Where(spec.Criterias.FirstOrDefault());
Assert.Equal(expectedCount, result.Count());
}

View File

@@ -1,7 +1,5 @@
using Microsoft.eShopWeb.ApplicationCore.Helpers.Query;
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
using Ardalis.Specification.QueryExtensions.Include;
using Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query;
using System;
using System.Collections.Generic;
namespace Microsoft.eShopWeb.UnitTests.Builders

View File

@@ -1,4 +1,5 @@
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
using Microsoft.eShopWeb.Web.Features.MyOrders;
using Moq;

View File

@@ -1,4 +1,5 @@
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
using Ardalis.Specification;
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
using Microsoft.eShopWeb.Web.Features.OrderDetails;
using Moq;