diff --git a/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/LoggingManagementSampleWebTestBase.cs b/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/LoggingManagementSampleWebTestBase.cs index 5fedb01..5b6e57e 100644 --- a/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/LoggingManagementSampleWebTestBase.cs +++ b/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/LoggingManagementSampleWebTestBase.cs @@ -8,7 +8,7 @@ namespace LoggingManagementSample { - public abstract class LoggingManagementSampleWebTestBase : AbpWebApplicationFactoryIntegratedTest + public abstract class LoggingManagementSampleWebTestBase : AbpWebApplicationFactoryIntegratedTest { protected virtual async Task GetResponseAsObjectAsync(string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) { diff --git a/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/LoggingManagementSampleWebTestStartup.cs b/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/LoggingManagementSampleWebTestStartup.cs deleted file mode 100644 index 1a9aeae..0000000 --- a/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/LoggingManagementSampleWebTestStartup.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Volo.Abp; - -namespace LoggingManagementSample -{ - public class LoggingManagementSampleWebTestStartup - { - public void ConfigureServices(IServiceCollection services) - { - services.AddApplication(); - } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - app.InitializeApplication(); - } - } -} \ No newline at end of file diff --git a/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/Program.cs b/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/Program.cs new file mode 100644 index 0000000..4ebd509 --- /dev/null +++ b/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/Program.cs @@ -0,0 +1,10 @@ +using LoggingManagementSample; +using Microsoft.AspNetCore.Builder; +using Volo.Abp.AspNetCore.TestBase; + +var builder = WebApplication.CreateBuilder(); +await builder.RunAbpModuleAsync(); + +public partial class Program +{ +} \ No newline at end of file diff --git a/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/WebContentDirectoryFinder.cs b/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/WebContentDirectoryFinder.cs deleted file mode 100644 index 2965b31..0000000 --- a/samples/LoggingManagementSample/test/LoggingManagementSample.Web.Tests/WebContentDirectoryFinder.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.IO; -using System.Linq; - -namespace LoggingManagementSample -{ - /// - /// This class is used to find root path of the web project. Used for; - /// 1. unit tests (to find views). - /// 2. entity framework core command line commands (to find the conn string). - /// - public static class WebContentDirectoryFinder - { - public static string CalculateContentRootFolder() - { - var domainAssemblyDirectoryPath = Path.GetDirectoryName(typeof(LoggingManagementSampleDomainModule).Assembly.Location); - if (domainAssemblyDirectoryPath == null) - { - throw new Exception($"Could not find location of {typeof(LoggingManagementSampleDomainModule).Assembly.FullName} assembly!"); - } - - var directoryInfo = new DirectoryInfo(domainAssemblyDirectoryPath); - while (!DirectoryContains(directoryInfo.FullName, "LoggingManagementSample.sln")) - { - if (directoryInfo.Parent == null) - { - throw new Exception("Could not find content root folder!"); - } - - directoryInfo = directoryInfo.Parent; - } - - var webFolder = Path.Combine(directoryInfo.FullName, $"src{Path.DirectorySeparatorChar}LoggingManagementSample.Web"); - if (Directory.Exists(webFolder)) - { - return webFolder; - } - - throw new Exception("Could not find root folder of the web project!"); - } - - private static bool DirectoryContains(string directory, string fileName) - { - return Directory.GetFiles(directory).Any(filePath => string.Equals(Path.GetFileName(filePath), fileName)); - } - } -}