Added a simple web api abstraction method

This commit is contained in:
2025-01-27 17:36:20 +01:00
parent 6842e48a70
commit 2f15986dbf
16 changed files with 259 additions and 37 deletions

View File

@@ -5,6 +5,8 @@ using HopFrame.Tests.Web.Models;
using HopFrame.Web;
using HopFrame.Web.Components.Dialogs;
using HopFrame.Web.Models;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.FluentUI.AspNetCore.Components;
using Moq;
@@ -34,7 +36,7 @@ public class HopFrameEditorTests : TestContext {
contextExplorerMock.Setup(e => e.GetTableManager("Table1")).Returns(Mock.Of<ITableManager>());
authHandlerMock.Setup(h => h.IsAuthenticatedAsync(It.IsAny<string>())).ReturnsAsync(true);
Services.AddHopFrame(config);
Services.AddHopFrame(config, null, false);
Services.AddSingleton(contextExplorerMock.Object);
Services.AddSingleton(authHandlerMock.Object);
Services.AddSingleton(dialogServiceMock.Object);

View File

@@ -25,7 +25,7 @@ public class HopFrameLayoutTests : TestContext {
.ReturnsAsync(true);
Services.AddSingleton(authHandlerMock.Object);
Services.AddHopFrame(config);
Services.AddHopFrame(config, null, false);
JSInterop.Mode = JSRuntimeMode.Loose;
@@ -61,7 +61,7 @@ public class HopFrameLayoutTests : TestContext {
.ReturnsAsync(false);
Services.AddSingleton(navMock);
Services.AddHopFrame(config);
Services.AddHopFrame(config, null, false);
Services.AddSingleton(authHandlerMock.Object);
JSInterop.Mode = JSRuntimeMode.Loose;

View File

@@ -22,7 +22,7 @@ public class HopFrameNavigationTests : TestContext {
.ReturnsAsync("John Doe");
Services.AddSingleton(authHandlerMock.Object);
Services.AddHopFrame(config);
Services.AddHopFrame(config, null, false);
JSInterop.Mode = JSRuntimeMode.Loose;
@@ -51,7 +51,7 @@ public class HopFrameNavigationTests : TestContext {
.ReturnsAsync("John Doe");
Services.AddSingleton(authHandlerMock.Object);
Services.AddHopFrame(config);
Services.AddHopFrame(config, null, false);
JSInterop.Mode = JSRuntimeMode.Loose;

View File

@@ -32,7 +32,7 @@ public class HopFrameSideMenuTests : TestContext {
Services.AddSingleton(contextExplorerMock.Object);
Services.AddSingleton(authHandlerMock.Object);
Services.AddHopFrame(config);
Services.AddHopFrame(config, null, false);
JSInterop.Mode = JSRuntimeMode.Loose;

View File

@@ -38,7 +38,7 @@ public class HopFrameHomeTests : TestContext {
authHandlerMock.Setup(h => h.IsAuthenticatedAsync(It.IsAny<string>()))
.ReturnsAsync(true);
Services.AddHopFrame(config);
Services.AddHopFrame(config, null, false);
Services.AddSingleton(contextExplorerMock.Object);
Services.AddSingleton(authHandlerMock.Object);

View File

@@ -35,7 +35,7 @@ public class HopFrameTablePageTests : TestContext {
authHandlerMock.Setup(h => h.IsAuthenticatedAsync(It.IsAny<string>())).ReturnsAsync(true);
managerMock.Setup(m => m.LoadPage(It.IsAny<int>(), It.IsAny<int>())).Returns(Enumerable.Empty<object>().AsAsyncQueryable());
Services.AddHopFrame(config);
Services.AddHopFrame(config, null, false);
Services.AddSingleton(contextExplorerMock.Object);
Services.AddSingleton(authHandlerMock.Object);
Services.AddSingleton(dialogServiceMock.Object);
@@ -77,7 +77,7 @@ public class HopFrameTablePageTests : TestContext {
contextExplorerMock.Setup(e => e.GetTableManager("Table1")).Returns(tableManagerMock.Object);
authHandlerMock.Setup(h => h.IsAuthenticatedAsync(It.IsAny<string>())).ReturnsAsync(true);
Services.AddHopFrame(new HopFrameConfig());
Services.AddHopFrame(new HopFrameConfig(), null, false);
Services.AddSingleton(contextExplorerMock.Object);
Services.AddSingleton(authHandlerMock.Object);
Services.AddSingleton(dialogServiceMock.Object);