Updated catalog unit test project to Net 6.0

This commit is contained in:
Sumit Ghosh 2021-10-14 15:59:04 +05:30
parent fb8bca5e8b
commit 90f0cff567
2 changed files with 108 additions and 110 deletions

View File

@ -1,4 +1,4 @@
using Catalog.API.IntegrationEvents;
using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Catalog.API;
@ -13,10 +13,10 @@ using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace UnitTest.Catalog.Application
namespace UnitTest.Catalog.Application;
public class CatalogControllerTest
{
public class CatalogControllerTest
{
private readonly DbContextOptions<CatalogContext> _dbOptions;
public CatalogControllerTest()
@ -116,10 +116,10 @@ namespace UnitTest.Catalog.Application
}
};
}
}
}
public class TestCatalogSettings : IOptionsSnapshot<CatalogSettings>
{
public class TestCatalogSettings : IOptionsSnapshot<CatalogSettings>
{
public CatalogSettings Value => new CatalogSettings
{
PicBaseUrl = "http://image-server.com/",
@ -127,6 +127,4 @@ namespace UnitTest.Catalog.Application
};
public CatalogSettings Get(string name) => Value;
}
}

View File

@ -7,9 +7,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0-preview.7.21378.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="5.0.0" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="6.0.0-preview.7.21377.19" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>