Added CatalogService tests
This commit is contained in:
parent
009411133d
commit
84c09e6236
@ -0,0 +1,17 @@
|
|||||||
|
using eShopOnContainers.Core.Services.Catalog;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace eShopOnContainers.UnitTests
|
||||||
|
{
|
||||||
|
public class BasketServiceTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public async Task GetFakeBasketTest()
|
||||||
|
{
|
||||||
|
var catalogMockService = new CatalogMockService();
|
||||||
|
var result = await catalogMockService.GetCatalogAsync();
|
||||||
|
Assert.NotEqual(0, result.Count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
using eShopOnContainers.Core.Services.Catalog;
|
using eShopOnContainers.Core.Services.Catalog;
|
||||||
|
using eShopOnContainers.Core.Services.RequestProvider;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
@ -9,9 +10,58 @@ namespace eShopOnContainers.UnitTests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task GetFakeCatalogTest()
|
public async Task GetFakeCatalogTest()
|
||||||
{
|
{
|
||||||
var catalogMockService = new CatalogMockService();
|
var catalogMockService = new CatalogMockService();
|
||||||
var result = await catalogMockService.GetCatalogAsync();
|
var catalog = await catalogMockService.GetCatalogAsync();
|
||||||
Assert.NotEqual(0, result.Count);
|
|
||||||
|
Assert.NotEqual(0, catalog.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetCatalogTest()
|
||||||
|
{
|
||||||
|
var requestProvider = new RequestProvider();
|
||||||
|
var catalogService = new CatalogService(requestProvider);
|
||||||
|
var catalog = await catalogService.GetCatalogAsync();
|
||||||
|
|
||||||
|
Assert.NotEqual(0, catalog.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetFakeCatalogBrandTest()
|
||||||
|
{
|
||||||
|
var catalogMockService = new CatalogMockService();
|
||||||
|
var catalogBrand = await catalogMockService.GetCatalogBrandAsync();
|
||||||
|
|
||||||
|
Assert.NotEqual(0, catalogBrand.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetCatalogBrandTest()
|
||||||
|
{
|
||||||
|
var requestProvider = new RequestProvider();
|
||||||
|
var catalogService = new CatalogService(requestProvider);
|
||||||
|
var catalogBrand = await catalogService.GetCatalogBrandAsync();
|
||||||
|
|
||||||
|
Assert.NotEqual(0, catalogBrand.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetFakeCatalogTypeTest()
|
||||||
|
{
|
||||||
|
var catalogMockService = new CatalogMockService();
|
||||||
|
var catalogType = await catalogMockService.GetCatalogTypeAsync();
|
||||||
|
|
||||||
|
Assert.NotEqual(0, catalogType.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetCatalogTypeTest()
|
||||||
|
{
|
||||||
|
var requestProvider = new RequestProvider();
|
||||||
|
var catalogService = new CatalogService(requestProvider);
|
||||||
|
var catalogType = await catalogService.GetCatalogTypeAsync();
|
||||||
|
|
||||||
|
Assert.NotEqual(0, catalogType.Count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -34,6 +34,7 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="BasketServiceTests.cs" />
|
||||||
<Compile Include="CatalogServiceTests.cs" />
|
<Compile Include="CatalogServiceTests.cs" />
|
||||||
<Compile Include="DummyTests.cs" />
|
<Compile Include="DummyTests.cs" />
|
||||||
<Compile Include="OrdersServiceTests.cs" />
|
<Compile Include="OrdersServiceTests.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user