Migrated content controller + related
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Extensions;
|
||||
using Umbraco.Web.BackOffice.Controllers;
|
||||
|
||||
namespace Umbraco.Tests.Integration.TestServer.Controllers
|
||||
{
|
||||
public class BackOfficeAssetsControllerTests: UmbracoWebApplicationFactory
|
||||
{
|
||||
private LinkGenerator _linkGenerator;
|
||||
|
||||
[OneTimeSetUp]
|
||||
public void GivenARequestToTheController()
|
||||
{
|
||||
_linkGenerator = Services.GetRequiredService<LinkGenerator>();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task EnsureSuccessStatusCode()
|
||||
{
|
||||
// Arrange
|
||||
var client = CreateClient();
|
||||
var url = _linkGenerator.GetUmbracoApiService<BackOfficeAssetsController>(x=>x.GetSupportedLocales());
|
||||
|
||||
// Act
|
||||
var response = await client.GetAsync(url);
|
||||
|
||||
// Assert
|
||||
Assert.GreaterOrEqual((int)response.StatusCode, 200);
|
||||
Assert.Less((int)response.StatusCode, 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
using Umbraco.Web.UI.BackOffice;
|
||||
|
||||
namespace Umbraco.Tests.Integration.TestServer
|
||||
{
|
||||
public class UmbracoWebApplicationFactory : WebApplicationFactory<Startup>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="LightInject.Microsoft.DependencyInjection" Version="3.3.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.4" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
<PackageReference Include="Moq" Version="4.13.1" />
|
||||
<PackageReference Include="nunit" Version="3.12.0" />
|
||||
@@ -30,6 +31,7 @@
|
||||
<ProjectReference Include="..\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj" />
|
||||
<ProjectReference Include="..\Umbraco.Tests.Common\Umbraco.Tests.Common.csproj" />
|
||||
<ProjectReference Include="..\Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj" />
|
||||
<ProjectReference Include="..\Umbraco.Web.UI.NetCore\Umbraco.Web.UI.NetCore.csproj" />
|
||||
<ProjectReference Include="..\Umbraco.Web.Website\Umbraco.Web.Website.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user