Skip to content

Commit 090a251

Browse files
committed
No need to define GetUrl in AbpProjectNameWebTestBase since they are included in AbpAspNetCoreIntegratedTestBase
1 parent c9d87c8 commit 090a251

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

test/AbpCompanyName.AbpProjectName.Web.Tests/AbpProjectNameWebTestBase.cs

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
using System;
2-
using System.Linq;
32
using System.Net;
43
using System.Net.Http;
54
using System.Threading.Tasks;
65
using Abp.AspNetCore.TestBase;
7-
using Abp.Extensions;
86
using AbpCompanyName.AbpProjectName.EntityFrameworkCore;
97
using AbpCompanyName.AbpProjectName.Tests.TestDatas;
108
using Microsoft.AspNetCore.Hosting;
11-
using Microsoft.AspNetCore.Routing;
129
using Newtonsoft.Json;
1310
using Newtonsoft.Json.Serialization;
1411
using Shouldly;
15-
using Abp.Collections.Extensions;
1612

1713
namespace AbpCompanyName.AbpProjectName.Web.Tests
1814
{
19-
public abstract class AbpProjectNameWebTestBase :AbpAspNetCoreIntegratedTestBase<Startup>
15+
public abstract class AbpProjectNameWebTestBase : AbpAspNetCoreIntegratedTestBase<Startup>
2016
{
2117
protected static readonly Lazy<string> ContentRootFolder;
2218

@@ -37,39 +33,6 @@ protected override IWebHostBuilder CreateWebHostBuilder()
3733
.UseContentRoot(ContentRootFolder.Value);
3834
}
3935

40-
#region GetUrl
41-
42-
protected virtual string GetUrl<TController>()
43-
{
44-
var controllerName = typeof(TController).Name;
45-
if (controllerName.EndsWith("Controller"))
46-
{
47-
controllerName = controllerName.Left(controllerName.Length - "Controller".Length);
48-
}
49-
50-
return "/" + controllerName;
51-
}
52-
53-
protected virtual string GetUrl<TController>(string actionName)
54-
{
55-
return GetUrl<TController>() + "/" + actionName;
56-
}
57-
58-
protected virtual string GetUrl<TController>(string actionName, object queryStringParamsAsAnonymousObject)
59-
{
60-
var url = GetUrl<TController>(actionName);
61-
62-
var dictionary = new RouteValueDictionary(queryStringParamsAsAnonymousObject);
63-
if (dictionary.Any())
64-
{
65-
url += "?" + dictionary.Select(d => $"{d.Key}={d.Value}").JoinAsString("&");
66-
}
67-
68-
return url;
69-
}
70-
71-
#endregion
72-
7336
#region Get response
7437

7538
protected async Task<T> GetResponseAsObjectAsync<T>(string url,

0 commit comments

Comments
 (0)