ソースを参照

移除单元测试代码

heteng 3 年 前
コミット
149721e551

+ 0 - 32
MicroServices/Business/Business.Tests/Business.Tests.csproj

@@ -1,32 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
-    <ImplicitUsings>enable</ImplicitUsings>
-    <Nullable>enable</Nullable>
-
-    <IsPackable>false</IsPackable>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Effort.EF6" Version="2.2.16" />
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
-    <PackageReference Include="Shouldly" Version="4.1.0" />
-    <PackageReference Include="Volo.Abp.Autofac" Version="7.0.2" />
-    <PackageReference Include="Volo.Abp.TestBase" Version="6.0.2" />
-    <PackageReference Include="xunit" Version="2.4.2" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
-      <PrivateAssets>all</PrivateAssets>
-    </PackageReference>
-    <PackageReference Include="coverlet.collector" Version="3.1.2">
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
-      <PrivateAssets>all</PrivateAssets>
-    </PackageReference>
-  </ItemGroup>
-
-  <ItemGroup>
-    <ProjectReference Include="..\Business.Application\Business.Application.csproj" />
-  </ItemGroup>
-
-</Project>

+ 0 - 65
MicroServices/Business/Business.Tests/BusinessTestBase.cs

@@ -1,65 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Volo.Abp;
-using Volo.Abp.Modularity;
-using Volo.Abp.Testing;
-using Volo.Abp.Uow;
-
-namespace Business.Tests
-{
-    /// <summary>
-    /// 测试基类
-    /// </summary>
-    public abstract class BusinessTestBase<TStartupModule> :AbpIntegratedTest<TStartupModule>
-        where TStartupModule:IAbpModule 
-    {
-        protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
-        {
-            options.UseAutofac();
-        }
-
-        protected virtual Task WithUnitOfWorkAsync(Func<Task> func)
-        {
-            return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func);
-        }
-
-        protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func<Task> action)
-        {
-            using (var scope = ServiceProvider.CreateScope())
-            {
-                var uowManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
-
-                using (var uow = uowManager.Begin(options))
-                {
-                    await action();
-
-                    await uow.CompleteAsync();
-                }
-            }
-        }
-
-        protected virtual Task<TResult> WithUnitOfWorkAsync<TResult>(Func<Task<TResult>> func)
-        {
-            return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func);
-        }
-
-        protected virtual async Task<TResult> WithUnitOfWorkAsync<TResult>(AbpUnitOfWorkOptions options, Func<Task<TResult>> func)
-        {
-            using (var scope = ServiceProvider.CreateScope())
-            {
-                var uowManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
-
-                using (var uow = uowManager.Begin(options))
-                {
-                    var result = await func();
-                    await uow.CompleteAsync();
-                    return result;
-                }
-            }
-        }
-    }
-}

+ 0 - 55
MicroServices/Business/Business.Tests/BusinessTestModule.cs

@@ -1,55 +0,0 @@
-using Autofac.Core;
-using BaseService.HttpApi.Client;
-using Business.Core.MongoDBHelper;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Volo.Abp.Application;
-using Volo.Abp.AutoMapper;
-using Volo.Abp.Http.Client.IdentityModel;
-using Volo.Abp.Identity;
-using Volo.Abp.Modularity;
-using XCZ;
-
-namespace Business.Tests
-{
-    [DependsOn(
-        typeof(BusinessDomainModule),
-        typeof(BusinessApplicationContractsModule),
-        typeof(AbpDddApplicationModule),
-        typeof(AbpHttpClientIdentityModelModule),
-        typeof(AbpIdentityHttpApiClientModule),
-        typeof(BaseServiceHttpApiClientModule),
-        typeof(FormApplicationModule),
-        typeof(FlowApplicationModule),
-        typeof(AbpAutoMapperModule))]
-    public class BusinessTestModule:AbpModule
-    {
-        public override void ConfigureServices(ServiceConfigurationContext context)
-        {
-            //MongoDBHelper依赖注入
-            context.Services.AddScoped(typeof(IMongoDB<>), typeof(MongoDBTools<>));
-
-            var configuration = context.Services.GetConfiguration();
-            //MongoDB依赖注入
-            ConfigureMongoDB(configuration);
-        }
-
-        /// <summary>
-        /// MongoDB依赖注入
-        /// </summary>
-        /// <param name="context"></param>
-        /// <param name="configuration"></param>
-        private void ConfigureMongoDB(IConfiguration configuration)
-        {
-            Configure<Config>(options => {
-                options.connectstring = configuration.GetConnectionString("MongoDB");
-                options.database = configuration.GetConnectionString("DBName");
-            });
-        }
-    }
-}

+ 0 - 47
MicroServices/Business/Business.Tests/ProductExamineTest.cs

@@ -1,47 +0,0 @@
-using Business.ResourceExamineManagement;
-using Business.ResourceExamineManagement.Dto;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Volo.Abp.Domain.Repositories;
-using XCZ.FormManagement;
-
-namespace Business.Tests
-{
-    /// <summary>
-    /// 产能检查单元测试
-    /// </summary>
-    public class ProductExamineTest:BusinessTestBase<BusinessTestModule>
-    {
-        /// <summary>
-        /// 资源检查服务
-        /// </summary>
-        private readonly IResourceExamineAppService _service;
-
-        /// <summary>
-        /// 构造函数
-        /// </summary>
-        public ProductExamineTest(IResourceExamineAppService service)
-        {
-            _service = service;
-        }
-
-        [Fact]
-        public async Task TestAddPoet()
-        {
-            await WithUnitOfWorkAsync(async () =>
-            {
-                SeorderentryDto input = new SeorderentryDto() { 
-                    sorderId = 1,
-                    tenantId = 102,
-                    factoryId = 10201
-                };
-                //Act
-                var a = await _service.ReceiveResult(input);
-                Assert.True(!string.IsNullOrEmpty(a));
-            });
-        }
-    }
-}

+ 0 - 1
MicroServices/Business/Business.Tests/Usings.cs

@@ -1 +0,0 @@
-global using Xunit;

+ 0 - 9
MicroServices/Business/Business.sln

@@ -25,8 +25,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bussiness.MongoModel", "Bus
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{4523E5A9-9492-49A2-8A1A-46080749D966}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Business.Tests", "Business.Tests\Business.Tests.csproj", "{5B827CCF-FF18-4A89-A11A-CB6476394280}"
-EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -73,17 +71,10 @@ Global
 		{604EACA4-3A26-425C-91B3-4516BA5282BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{604EACA4-3A26-425C-91B3-4516BA5282BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{604EACA4-3A26-425C-91B3-4516BA5282BB}.Release|Any CPU.Build.0 = Release|Any CPU
-		{5B827CCF-FF18-4A89-A11A-CB6476394280}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{5B827CCF-FF18-4A89-A11A-CB6476394280}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{5B827CCF-FF18-4A89-A11A-CB6476394280}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{5B827CCF-FF18-4A89-A11A-CB6476394280}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
-	GlobalSection(NestedProjects) = preSolution
-		{5B827CCF-FF18-4A89-A11A-CB6476394280} = {4523E5A9-9492-49A2-8A1A-46080749D966}
-	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {2E43F5D5-31CD-4424-A538-4C716E71D9AF}
 	EndGlobalSection