Move end-to-end tests to better place
DELETE
WalletWasabi.Tests/UnitTests/WabiSabi/Backend/Filters/IdempotencyActionFilterTests.cs
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.Abstractions;
-using Microsoft.AspNetCore.Mvc.Filters;
-using Microsoft.AspNetCore.Mvc.ModelBinding;
-using Microsoft.AspNetCore.Routing;
-using Microsoft.Extensions.Caching.Memory;
-using Moq;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using WalletWasabi.Backend.Filters;
-using Xunit;
-
-namespace WalletWasabi.Tests.UnitTests.WabiSabi.Backend.Filters
-{
- public class IdempotencyActionFilterTests
- {
- [Fact]
- public void ShouldCacheResponse()
- {
- var helloBody = Encoding.UTF8.GetBytes("Hello world");
- using var stream1 = new MemoryStream(helloBody);
- var actionContext = CreateActionExecutingContext(stream1);
- var cache = new MemoryCache(new MemoryCacheOptions());
- var filter = new IdempotentActionFilterAttributeImpl(cache);
-
- filter.OnActionExecuting(actionContext);
-
- var resultContext = CreateResulExecutedContext(actionContext);
- filter.OnResultExecuted(resultContext);
-
- var byeBody = Encoding.UTF8.GetBytes("Bye world");
- using var stream2 = new MemoryStream(byeBody);
- actionContext = CreateActionExecutingContext(stream2);
- filter.OnActionExecuting(actionContext);
-
- Assert.Equal(1, cache.Count);
-
- var returned = Assert.IsType<OkObjectResult>(resultContext.Result);
- var objValue = Assert.IsType<KeyValuePair<string, string>>(returned.Value);
- Assert.Equal("Greeting", objValue.Key);
- Assert.Equal("Hello world", objValue.Value);
- }
-
- private static ActionExecutingContext CreateActionExecutingContext(Stream bodyStream)
- {
- var modelState = new ModelStateDictionary();
- var httpContext = new DefaultHttpContext();
- httpContext.Request.Path = "/api";
- httpContext.Request.Body = bodyStream;
- var actionContext = new ActionExecutingContext(
- new ActionContext(
- httpContext: httpContext,
- routeData: new RouteData(),
- actionDescriptor: new ActionDescriptor(),
- modelState: modelState),
- new List<IFilterMetadata>(),
- new Dictionary<string, object>(),
- new Mock<Controller>().Object);
-
- return actionContext;
- }
-
- private static ResultExecutedContext CreateResulExecutedContext(ActionExecutingContext actionContext)
- {
- return new ResultExecutedContext(
- actionContext,
- actionContext.Filters,
- new OkObjectResult(new KeyValuePair<string, string>("Greeting", "Hello world")),
- actionContext.Controller);
- }
- }
-}
\ No newline at end of file

RENAME
WalletWasabi.Tests/RegressionTests/WabiSabi/BackgroundServiceStarter.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/BackgroundServiceStarter.cs
@@ -2,7 +2,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
-namespace WalletWasabi.Tests.RegressionTests.WabiSabi
+namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
{
// BackgroundServiceStarter is a IHostedService whose only responsibility is to start/stop other service.
// It provides the most ellegant way to be able to register a singleton hosted service. ASPNET provides

RENAME
WalletWasabi.Tests/RegressionTests/WabiSabi/Startup.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/Startup.cs
@@ -4,7 +4,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using WalletWasabi.WabiSabi.Models.Serialization;
-namespace WalletWasabi.Tests.RegressionTests.WabiSabi
+namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
{
public class Startup
{

RENAME
WalletWasabi.Tests/RegressionTests/WabiSabi/WabiSabiApiApplicationFactory.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiApiApplicationFactory.cs
@@ -21,7 +21,7 @@ using WalletWasabi.WabiSabi.Client;
using WalletWasabi.WabiSabi.Crypto;
using WalletWasabi.WabiSabi.Models.MultipartyTransaction;
-namespace WalletWasabi.Tests.RegressionTests.WabiSabi
+namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
{
public class WabiSabiApiApplicationFactory<TStartup> : WebApplicationFactory<TStartup> where TStartup : class
{

RENAME
WalletWasabi.Tests/RegressionTests/WabiSabi/WabiSabiHttpApiIntegrationTests.cs
WalletWasabi.Tests/UnitTests/WabiSabi/Integration/WabiSabiHttpApiIntegrationTests.cs
@@ -10,7 +10,7 @@ using WalletWasabi.WabiSabi.Backend.Models;
using WalletWasabi.WabiSabi.Models.MultipartyTransaction;
using Xunit;
-namespace WalletWasabi.Tests.RegressionTests.WabiSabi
+namespace WalletWasabi.Tests.UnitTests.WabiSabi.Integration
{
public class WabiSabiHttpApiIntegrationTests : IClassFixture<WabiSabiApiApplicationFactory<Startup>>
{

Move end-to-end tests to better place