From 18589f9a73f655244614aa55cd6b773d27e26456 Mon Sep 17 00:00:00 2001 From: Eric Fleming Date: Sun, 14 Jun 2020 20:55:00 -0400 Subject: [PATCH] Make testing name scheme consistent (#395) * Updating CahceHelperTests names * Updating OrdersTests names * Removing tests for "Include" functionality as it lives in a NuGet Package now * Updating Integration Test anems --- .../BasketRepositoryTests/SetQuantities.cs | 3 +- ...ync_Should.cs => GetByIdWithItemsAsync.cs} | 10 +-- .../ApplicationCore/Helpers/Query/Book.cs | 16 ---- .../Query/IncludeAggregatorTests/Include.cs | 48 ----------- .../Query/IncludeQueryTests/Include.cs | 80 ------------------- .../Query/IncludeQueryTests/ThenInclude.cs | 78 ------------------ .../Query/IncludeVisitorTests/Visit.cs | 55 ------------- .../ApplicationCore/Helpers/Query/Person.cs | 19 ----- .../BasketServiceTests/DeleteBasket.cs | 2 +- .../BasketServiceTests/SetQuantities.cs | 1 - .../UnitTests/Builders/IncludeQueryBuilder.cs | 27 ------- .../{GetMyOrders_Should.cs => GetMyOrders.cs} | 8 +- ...erDetails_Should.cs => GetOrderDetails.cs} | 12 +-- tests/UnitTests/UnitTests.csproj | 4 + ...ey_Should.cs => GenerateBrandsCacheKey.cs} | 4 +- ...ould.cs => GenerateCatalogItemCacheKey.cs} | 4 +- ...Key_Should.cs => GenerateTypesCacheKey.cs} | 4 +- 17 files changed, 26 insertions(+), 349 deletions(-) rename tests/IntegrationTests/Repositories/OrderRepositoryTests/{GetByIdWithItemsAsync_Should.cs => GetByIdWithItemsAsync.cs} (89%) delete mode 100644 tests/UnitTests/ApplicationCore/Helpers/Query/Book.cs delete mode 100644 tests/UnitTests/ApplicationCore/Helpers/Query/IncludeAggregatorTests/Include.cs delete mode 100644 tests/UnitTests/ApplicationCore/Helpers/Query/IncludeQueryTests/Include.cs delete mode 100644 tests/UnitTests/ApplicationCore/Helpers/Query/IncludeQueryTests/ThenInclude.cs delete mode 100644 tests/UnitTests/ApplicationCore/Helpers/Query/IncludeVisitorTests/Visit.cs delete mode 100644 tests/UnitTests/ApplicationCore/Helpers/Query/Person.cs delete mode 100644 tests/UnitTests/Builders/IncludeQueryBuilder.cs rename tests/UnitTests/MediatorHandlers/OrdersTests/{GetMyOrders_Should.cs => GetMyOrders.cs} (85%) rename tests/UnitTests/MediatorHandlers/OrdersTests/{GetOrderDetails_Should.cs => GetOrderDetails.cs} (80%) rename tests/UnitTests/Web/Extensions/CacheHelpersTests/{GenerateBrandsCacheKey_Should.cs => GenerateBrandsCacheKey.cs} (76%) rename tests/UnitTests/Web/Extensions/CacheHelpersTests/{GenerateCatalogItemCacheKey_Should.cs => GenerateCatalogItemCacheKey.cs} (82%) rename tests/UnitTests/Web/Extensions/CacheHelpersTests/{GenerateTypesCacheKey_Should.cs => GenerateTypesCacheKey.cs} (76%) diff --git a/tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs b/tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs index 5a027e9..7093614 100644 --- a/tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs +++ b/tests/IntegrationTests/Repositories/BasketRepositoryTests/SetQuantities.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Microsoft.eShopWeb.ApplicationCore.Entities.BasketAggregate; diff --git a/tests/IntegrationTests/Repositories/OrderRepositoryTests/GetByIdWithItemsAsync_Should.cs b/tests/IntegrationTests/Repositories/OrderRepositoryTests/GetByIdWithItemsAsync.cs similarity index 89% rename from tests/IntegrationTests/Repositories/OrderRepositoryTests/GetByIdWithItemsAsync_Should.cs rename to tests/IntegrationTests/Repositories/OrderRepositoryTests/GetByIdWithItemsAsync.cs index 1f8c75f..15d4d1f 100644 --- a/tests/IntegrationTests/Repositories/OrderRepositoryTests/GetByIdWithItemsAsync_Should.cs +++ b/tests/IntegrationTests/Repositories/OrderRepositoryTests/GetByIdWithItemsAsync.cs @@ -6,19 +6,17 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Xunit; -using Xunit.Abstractions; namespace Microsoft.eShopWeb.IntegrationTests.Repositories.OrderRepositoryTests { - public class GetByIdWithItemsAsync_Should + public class GetByIdWithItemsAsync { private readonly CatalogContext _catalogContext; private readonly OrderRepository _orderRepository; private OrderBuilder OrderBuilder { get; } = new OrderBuilder(); - private readonly ITestOutputHelper _output; - public GetByIdWithItemsAsync_Should(ITestOutputHelper output) + + public GetByIdWithItemsAsync() { - _output = output; var dbOptions = new DbContextOptionsBuilder() .UseInMemoryDatabase(databaseName: "TestCatalog") .Options; @@ -27,7 +25,7 @@ namespace Microsoft.eShopWeb.IntegrationTests.Repositories.OrderRepositoryTests } [Fact] - public async Task GetOrderAndItemsByOrderId_When_MultipleOrdersPresent() + public async Task GetOrderAndItemsByOrderIdWhenMultipleOrdersPresent() { //Arrange var itemOneUnitPrice = 5.50m; diff --git a/tests/UnitTests/ApplicationCore/Helpers/Query/Book.cs b/tests/UnitTests/ApplicationCore/Helpers/Query/Book.cs deleted file mode 100644 index 97bab4f..0000000 --- a/tests/UnitTests/ApplicationCore/Helpers/Query/Book.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query -{ - public class Book - { - public string Title { get; set; } - public DateTime PublishingDate { get; set; } - public Person Author { get; set; } - - public int GetNumberOfSales() - { - return 0; - } - } -} diff --git a/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeAggregatorTests/Include.cs b/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeAggregatorTests/Include.cs deleted file mode 100644 index 77914bd..0000000 --- a/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeAggregatorTests/Include.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Ardalis.Specification.QueryExtensions.Include; -using Xunit; - -namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query.IncludeAggregatorTests -{ - public class Include - { - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeSimpleType() - { - var includeAggregator = new IncludeAggregator(); - - // There may be ORM libraries where including a simple type makes sense. - var includeQuery = includeAggregator.Include(p => p.Age); - - Assert.Contains(includeQuery.Paths, path => path == nameof(Person.Age)); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeFunction() - { - var includeAggregator = new IncludeAggregator(); - - // This include does not make much sense, but it should at least do not modify the paths. - var includeQuery = includeAggregator.Include(p => p.FavouriteBook.GetNumberOfSales()); - - Assert.Contains(includeQuery.Paths, path => path == nameof(Person.FavouriteBook)); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeObject() - { - var includeAggregator = new IncludeAggregator(); - var includeQuery = includeAggregator.Include(p => p.FavouriteBook.Author); - - Assert.Contains(includeQuery.Paths, path => path == $"{nameof(Person.FavouriteBook)}.{nameof(Book.Author)}"); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeCollection() - { - var includeAggregator = new IncludeAggregator(); - var includeQuery = includeAggregator.Include(o => o.Author.Friends); - - Assert.Contains(includeQuery.Paths, path => path == $"{nameof(Book.Author)}.{nameof(Person.Friends)}"); - } - } -} diff --git a/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeQueryTests/Include.cs b/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeQueryTests/Include.cs deleted file mode 100644 index aa99722..0000000 --- a/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeQueryTests/Include.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Ardalis.Specification.QueryExtensions.Include; -using Microsoft.eShopWeb.UnitTests.Builders; -using Xunit; - -namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query.IncludeQueryTests -{ - public class Include - { - private IncludeQueryBuilder _includeQueryBuilder = new IncludeQueryBuilder(); - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeSimpleType() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - - // There may be ORM libraries where including a simple type makes sense. - var newIncludeQuery = includeQuery.Include(b => b.Title); - - Assert.Contains(newIncludeQuery.Paths, path => path == nameof(Book.Title)); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeFunction() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - - // This include does not make much sense, but it should at least do not modify paths. - var newIncludeQuery = includeQuery.Include(b => b.GetNumberOfSales()); - - // The resulting paths should not include number of sales. - Assert.DoesNotContain(newIncludeQuery.Paths, path => path == nameof(Book.GetNumberOfSales)); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeObject() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - var newIncludeQuery = includeQuery.Include(b => b.Author); - - Assert.Contains(newIncludeQuery.Paths, path => path == nameof(Book.Author)); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeCollection() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - - var newIncludeQuery = includeQuery.Include(b => b.Author.Friends); - var expectedPath = $"{nameof(Book.Author)}.{nameof(Person.Friends)}"; - - Assert.Contains(newIncludeQuery.Paths, path => path == expectedPath); - } - - [Fact] - public void Should_IncreaseNumberOfPathsByOne() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - var numberOfPathsBeforeInclude = includeQuery.Paths.Count; - - var newIncludeQuery = includeQuery.Include(b => b.Author.Friends); - var numberOfPathsAferInclude = newIncludeQuery.Paths.Count; - - var expectedNumerOfPaths = numberOfPathsBeforeInclude + 1; - - Assert.Equal(expectedNumerOfPaths, numberOfPathsAferInclude); - } - - [Fact] - public void Should_NotModifyAnotherPath() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - var pathsBeforeInclude = includeQuery.Paths; - - var newIncludeQuery = includeQuery.Include(b => b.Author.Friends); - var pathsAfterInclude = newIncludeQuery.Paths; - - Assert.Subset(pathsAfterInclude, pathsBeforeInclude); - } - } -} diff --git a/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeQueryTests/ThenInclude.cs b/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeQueryTests/ThenInclude.cs deleted file mode 100644 index cf69f7d..0000000 --- a/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeQueryTests/ThenInclude.cs +++ /dev/null @@ -1,78 +0,0 @@ -using Ardalis.Specification.QueryExtensions.Include; -using Microsoft.eShopWeb.UnitTests.Builders; -using System.Linq; -using Xunit; - -namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query.IncludeQueryTests -{ - public class ThenInclude - { - private IncludeQueryBuilder _includeQueryBuilder = new IncludeQueryBuilder(); - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeSimpleType() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - var pathBeforeInclude = includeQuery.Paths.First(); - - // There may be ORM libraries where including a simple type makes sense. - var newIncludeQuery = includeQuery.ThenInclude(p => p.Age); - var pathAfterInclude = newIncludeQuery.Paths.First(); - var expectedPath = $"{pathBeforeInclude}.{nameof(Person.Age)}"; - - Assert.Equal(expectedPath, pathAfterInclude); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeFunction() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - var pathBeforeInclude = includeQuery.Paths.First(); - - // This include does not make much sense, but it should at least not modify the paths. - var newIncludeQuery = includeQuery.ThenInclude(p => p.GetQuote()); - var pathAfterInclude = newIncludeQuery.Paths.First(); - - Assert.Equal(pathBeforeInclude, pathAfterInclude); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeObject() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - var pathBeforeInclude = includeQuery.Paths.First(); - - var newIncludeQuery = includeQuery.ThenInclude(p => p.FavouriteBook); - var pathAfterInclude = newIncludeQuery.Paths.First(); - var expectedPath = $"{pathBeforeInclude}.{nameof(Person.FavouriteBook)}"; - - Assert.Equal(expectedPath, pathAfterInclude); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludeCollection() - { - var includeQuery = _includeQueryBuilder.WithObjectAsPreviousProperty(); - var pathBeforeInclude = includeQuery.Paths.First(); - - var newIncludeQuery = includeQuery.ThenInclude(p => p.Friends); - var pathAfterInclude = newIncludeQuery.Paths.First(); - var expectedPath = $"{pathBeforeInclude}.{nameof(Person.Friends)}"; - - Assert.Equal(expectedPath, pathAfterInclude); - } - - [Fact] - public void Should_ReturnIncludeQueryWithCorrectPath_IfIncludePropertyOverCollection() - { - var includeQuery = _includeQueryBuilder.WithCollectionAsPreviousProperty(); - var pathBeforeInclude = includeQuery.Paths.First(); - - var newIncludeQuery = includeQuery.ThenInclude(p => p.FavouriteBook); - var pathAfterInclude = newIncludeQuery.Paths.First(); - var expectedPath = $"{pathBeforeInclude}.{nameof(Person.FavouriteBook)}"; - - Assert.Equal(expectedPath, pathAfterInclude); - } - } -} diff --git a/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeVisitorTests/Visit.cs b/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeVisitorTests/Visit.cs deleted file mode 100644 index 74abe0f..0000000 --- a/tests/UnitTests/ApplicationCore/Helpers/Query/IncludeVisitorTests/Visit.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Ardalis.Specification.QueryExtensions.Include; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using Xunit; - -namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query.IncludeVisitorTests -{ - public class Visit - { - [Fact] - public void Should_SetPath_IfPassedExpressionWithSimpleType() - { - var visitor = new IncludeVisitor(); - Expression> expression = (book) => book.Author.FirstName; - visitor.Visit(expression); - - var expectedPath = $"{nameof(Book.Author)}.{nameof(Person.FirstName)}"; - Assert.Equal(expectedPath, visitor.Path); - } - - [Fact] - public void Should_SetPath_IfPassedExpressionWithObject() - { - var visitor = new IncludeVisitor(); - Expression> expression = (book) => book.Author.FavouriteBook; - visitor.Visit(expression); - - var expectedPath = $"{nameof(Book.Author)}.{nameof(Person.FavouriteBook)}"; - Assert.Equal(expectedPath, visitor.Path); - } - - [Fact] - public void Should_SetPath_IfPassedExpressionWithCollection() - { - var visitor = new IncludeVisitor(); - Expression>> expression = (book) => book.Author.Friends; - visitor.Visit(expression); - - var expectedPath = $"{nameof(Book.Author)}.{nameof(Person.Friends)}"; - Assert.Equal(expectedPath, visitor.Path); - } - - [Fact] - public void Should_SetPath_IfPassedExpressionWithFunction() - { - var visitor = new IncludeVisitor(); - Expression> expression = (book) => book.Author.GetQuote(); - visitor.Visit(expression); - - var expectedPath = nameof(Book.Author); - Assert.Equal(expectedPath, visitor.Path); - } - } -} diff --git a/tests/UnitTests/ApplicationCore/Helpers/Query/Person.cs b/tests/UnitTests/ApplicationCore/Helpers/Query/Person.cs deleted file mode 100644 index bcbb2c3..0000000 --- a/tests/UnitTests/ApplicationCore/Helpers/Query/Person.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; - -namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query -{ - public class Person - { - public int Age { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - - public Book FavouriteBook { get; set; } - public List Friends { get; set; } - - public string GetQuote() - { - return string.Empty; - } - } -} diff --git a/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/DeleteBasket.cs b/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/DeleteBasket.cs index 05a56c0..4e09a72 100644 --- a/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/DeleteBasket.cs +++ b/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/DeleteBasket.cs @@ -18,7 +18,7 @@ namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Services.BasketServiceTes } [Fact] - public async Task Should_InvokeBasketRepositoryDeleteAsync_Once() + public async Task ShouldInvokeBasketRepositoryDeleteAsyncOnce() { var basket = new Basket(_buyerId); basket.AddItem(1, It.IsAny(), It.IsAny()); diff --git a/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/SetQuantities.cs b/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/SetQuantities.cs index 6f90db1..4f47a20 100644 --- a/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/SetQuantities.cs +++ b/tests/UnitTests/ApplicationCore/Services/BasketServiceTests/SetQuantities.cs @@ -36,6 +36,5 @@ namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Services.BasketServiceTes await Assert.ThrowsAsync(async () => await basketService.SetQuantities(123, null)); } - } } diff --git a/tests/UnitTests/Builders/IncludeQueryBuilder.cs b/tests/UnitTests/Builders/IncludeQueryBuilder.cs deleted file mode 100644 index ec99446..0000000 --- a/tests/UnitTests/Builders/IncludeQueryBuilder.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Ardalis.Specification.QueryExtensions.Include; -using Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query; -using System.Collections.Generic; - -namespace Microsoft.eShopWeb.UnitTests.Builders -{ - public class IncludeQueryBuilder - { - public IncludeQuery> WithCollectionAsPreviousProperty() - { - var pathMap = new Dictionary(); - var query = new IncludeQuery>(pathMap); - pathMap[query] = nameof(Person.Friends); - - return query; - } - - public IncludeQuery WithObjectAsPreviousProperty() - { - var pathMap = new Dictionary(); - var query = new IncludeQuery(pathMap); - pathMap[query] = nameof(Book.Author); - - return query; - } - } -} diff --git a/tests/UnitTests/MediatorHandlers/OrdersTests/GetMyOrders_Should.cs b/tests/UnitTests/MediatorHandlers/OrdersTests/GetMyOrders.cs similarity index 85% rename from tests/UnitTests/MediatorHandlers/OrdersTests/GetMyOrders_Should.cs rename to tests/UnitTests/MediatorHandlers/OrdersTests/GetMyOrders.cs index d2aef2d..224fd28 100644 --- a/tests/UnitTests/MediatorHandlers/OrdersTests/GetMyOrders_Should.cs +++ b/tests/UnitTests/MediatorHandlers/OrdersTests/GetMyOrders.cs @@ -10,11 +10,11 @@ using Xunit; namespace Microsoft.eShopWeb.UnitTests.MediatorHandlers.OrdersTests { - public class GetMyOrders_Should + public class GetMyOrders { private readonly Mock _mockOrderRepository; - public GetMyOrders_Should() + public GetMyOrders() { var item = new OrderItem(new CatalogItemOrdered(1, "ProductName", "URI"), 10.00m, 10); var address = new Address(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()); @@ -25,9 +25,9 @@ namespace Microsoft.eShopWeb.UnitTests.MediatorHandlers.OrdersTests } [Fact] - public async Task NotReturnNull_If_OrdersArePresent() + public async Task NotReturnNullIfOrdersArePresent() { - var request = new GetMyOrders("SomeUserName"); + var request = new eShopWeb.Web.Features.MyOrders.GetMyOrders("SomeUserName"); var handler = new GetMyOrdersHandler(_mockOrderRepository.Object); diff --git a/tests/UnitTests/MediatorHandlers/OrdersTests/GetOrderDetails_Should.cs b/tests/UnitTests/MediatorHandlers/OrdersTests/GetOrderDetails.cs similarity index 80% rename from tests/UnitTests/MediatorHandlers/OrdersTests/GetOrderDetails_Should.cs rename to tests/UnitTests/MediatorHandlers/OrdersTests/GetOrderDetails.cs index a1c334c..720a7f7 100644 --- a/tests/UnitTests/MediatorHandlers/OrdersTests/GetOrderDetails_Should.cs +++ b/tests/UnitTests/MediatorHandlers/OrdersTests/GetOrderDetails.cs @@ -10,11 +10,11 @@ using Xunit; namespace Microsoft.eShopWeb.UnitTests.MediatorHandlers.OrdersTests { - public class GetOrderDetails_Should + public class GetOrderDetails { private readonly Mock _mockOrderRepository; - public GetOrderDetails_Should() + public GetOrderDetails() { var item = new OrderItem(new CatalogItemOrdered(1, "ProductName", "URI"), 10.00m, 10); var address = new Address(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()); @@ -25,9 +25,9 @@ namespace Microsoft.eShopWeb.UnitTests.MediatorHandlers.OrdersTests } [Fact] - public async Task NotBeNull_If_Order_Exists() + public async Task NotBeNullIfOrderExists() { - var request = new GetOrderDetails("SomeUserName", 0); + var request = new eShopWeb.Web.Features.OrderDetails.GetOrderDetails("SomeUserName", 0); var handler = new GetOrderDetailsHandler(_mockOrderRepository.Object); @@ -37,9 +37,9 @@ namespace Microsoft.eShopWeb.UnitTests.MediatorHandlers.OrdersTests } [Fact] - public async Task BeNull_If_Order_Not_found() + public async Task BeNullIfOrderNotFound() { - var request = new GetOrderDetails("SomeUserName", 100); + var request = new eShopWeb.Web.Features.OrderDetails.GetOrderDetails("SomeUserName", 100); var handler = new GetOrderDetailsHandler(_mockOrderRepository.Object); diff --git a/tests/UnitTests/UnitTests.csproj b/tests/UnitTests/UnitTests.csproj index 7d5834b..f0b97b8 100644 --- a/tests/UnitTests/UnitTests.csproj +++ b/tests/UnitTests/UnitTests.csproj @@ -30,4 +30,8 @@ + + + + diff --git a/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateBrandsCacheKey_Should.cs b/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateBrandsCacheKey.cs similarity index 76% rename from tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateBrandsCacheKey_Should.cs rename to tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateBrandsCacheKey.cs index 52b03df..4c2c896 100644 --- a/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateBrandsCacheKey_Should.cs +++ b/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateBrandsCacheKey.cs @@ -3,10 +3,10 @@ using Xunit; namespace Microsoft.eShopWeb.UnitTests.Web.Extensions.CacheHelpersTests { - public class GenerateBrandsCacheKey_Should + public class GenerateBrandsCacheKey { [Fact] - public void ReturnBrandsCacheKey() + public void ReturnsBrandsCacheKey() { var result = CacheHelpers.GenerateBrandsCacheKey(); diff --git a/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateCatalogItemCacheKey_Should.cs b/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateCatalogItemCacheKey.cs similarity index 82% rename from tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateCatalogItemCacheKey_Should.cs rename to tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateCatalogItemCacheKey.cs index 025b5df..a40f61b 100644 --- a/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateCatalogItemCacheKey_Should.cs +++ b/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateCatalogItemCacheKey.cs @@ -4,10 +4,10 @@ using Xunit; namespace Microsoft.eShopWeb.UnitTests.Web.Extensions.CacheHelpersTests { - public class GenerateCatalogItemCacheKey_Should + public class GenerateCatalogItemCacheKey { [Fact] - public void ReturnCatalogItemCacheKey() + public void ReturnsCatalogItemCacheKey() { var pageIndex = 0; int? brandId = null; diff --git a/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateTypesCacheKey_Should.cs b/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateTypesCacheKey.cs similarity index 76% rename from tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateTypesCacheKey_Should.cs rename to tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateTypesCacheKey.cs index f7cce99..96bdd2a 100644 --- a/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateTypesCacheKey_Should.cs +++ b/tests/UnitTests/Web/Extensions/CacheHelpersTests/GenerateTypesCacheKey.cs @@ -3,10 +3,10 @@ using Xunit; namespace Microsoft.eShopWeb.UnitTests.Web.Extensions.CacheHelpersTests { - public class GenerateTypesCacheKey_Should + public class GenerateTypesCacheKey { [Fact] - public void ReturnTypesCacheKey() + public void ReturnsTypesCacheKey() { var result = CacheHelpers.GenerateTypesCacheKey();