Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c784eda
Convert DotNetNuke.Tests.Utilities to SDK project
bdukes Dec 3, 2025
9fef834
Convert DotNetNuke.Tests.Web.Mvc to SDK project
bdukes Dec 3, 2025
9071a27
Convert DotNetNuke.Tests.Web to SDK project
bdukes Dec 3, 2025
ab0cfed
Convert DotNetNuke.Tests.UI to SDK project
bdukes Dec 3, 2025
59e4ed5
Convert DotNetNuke.Tests.Modules.DDRMenu to SDK project
bdukes Dec 3, 2025
611b245
Convert DotNetNuke.Tests.Modules to SDK project
bdukes Dec 3, 2025
a620c45
Convert DotNetNuke.Tests.Mail to SDK project
bdukes Dec 4, 2025
632d5ce
Convert DotNetNuke.Tests.Data to SDK project
bdukes Dec 4, 2025
d8d75a8
Convert DotNetNuke.Tests.Authentication to SDK project
bdukes Dec 4, 2025
d4d71f5
Convert DotNetNuke.Tests.AspNetCCP to SDK project
bdukes Dec 4, 2025
6dfb631
Convert DotNetNuke.Tests.Content to SDK project
bdukes Dec 4, 2025
679989d
Convert DotNetNuke.Tests.Core to SDK project
bdukes Dec 4, 2025
262a30a
Convert Dnn.PersonaBar.Users.Tests to SDK project
bdukes Dec 4, 2025
da86765
Convert Dnn.PersonaBar.Security.Tests to SDK project
bdukes Dec 4, 2025
334532a
Convert Dnn.PersonaBar.Pages.Tests to SDK project
bdukes Dec 4, 2025
4d21a02
Convert Dnn.PersonaBar.ConfigConsole.Tests to SDK project
bdukes Dec 4, 2025
4cbe4f3
Fix error when running URL tests
bdukes Dec 5, 2025
e0f3db8
Misc cleanup in DotNetNuke.Tests.Urls
bdukes Dec 4, 2025
cd6ad04
Convert DotNetNuke.Tests.Urls to SDK project
bdukes Dec 4, 2025
d9d8f61
Adjust timing of UrlTestBase config
bdukes Dec 5, 2025
1568ef1
Fix typo in site template page name
bdukes Dec 5, 2025
301aa6c
Remove usages of Is.True with more exact constraints
bdukes Dec 5, 2025
ed1c208
Start using async/await for integration test HTTP
bdukes Dec 5, 2025
021d2a6
Convert DotNetNuke.Tests.Integration to SDK project
bdukes Dec 5, 2025
68cafe4
Fix path to DotNetNuke.Tests.Utilities assembly
bdukes Dec 8, 2025
7795893
Convert DNN.Integration.Test.Framework to SDK project
bdukes Dec 8, 2025
7b8f9ec
Bump test NuGet packages
bdukes Dec 8, 2025
9099308
Fix not finding test assemblies
bdukes Dec 8, 2025
5dbd6e6
Ignore exceptions copying test files
bdukes Dec 8, 2025
e2ca662
Bump source generator tests from .NET 8 to 10
bdukes Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ namespace DotNetNuke.Build
public class Program
{
/// <summary>The version of the Microsoft.TestPlatform NuGet package.</summary>
internal const string MicrosoftTestPlatformVersion = "17.14.1";
internal const string MicrosoftTestPlatformVersion = "18.0.1";

/// <summary>The version of the NUnit3TestAdapter NuGet package.</summary>
internal const string NUnit3TestAdapterVersion = "5.0.0";
internal const string NUnit3TestAdapterVersion = "6.0.0";

/// <summary>Runs the build process.</summary>
/// <param name="args">The arguments from the command line.</param>
Expand Down
4 changes: 2 additions & 2 deletions Build/Tasks/UnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public sealed class UnitTests : FrostingTask<Context>
/// <inheritdoc/>
public override void Run(Context context)
{
var testAssemblies = context.GetFiles($@"**\bin\{context.BuildConfiguration}\DotNetNuke.Tests.*.dll");
testAssemblies += context.GetFiles($@"**\bin\{context.BuildConfiguration}\Dnn.PersonaBar.*.Tests.dll");
var testAssemblies = context.GetFiles(@"**\bin\**\DotNetNuke.Tests.*.dll");
testAssemblies += context.GetFiles(@"**\bin\**\Dnn.PersonaBar.*.Tests.dll");
testAssemblies -= context.GetFiles(@"**\DotNetNuke.Tests.Utilities.dll");

// TODO: address issues to allow these tests to run
Expand Down
4 changes: 2 additions & 2 deletions DNN Platform/Library/Entities/Portals/PortalController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1155,9 +1155,9 @@ public static string GetActivePortalLanguage(IHostSettings hostSettings, IApplic

// PortalSettings IS Nothing - probably means we haven't set it yet (in Begin Request)
// so try detecting the user's cookie
if (HttpContext.Current.Request["language"] != null)
if (context.Request["language"] != null)
{
language = HttpContext.Current.Request["language"];
language = context.Request["language"];
isDefaultLanguage = false;
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<iconUrl>https://dnncommunity.org/favicon.ico</iconUrl>
</metadata>
<files>
<file src="Dnn.Platform\DNN Platform\Tests\DotNetNuke.Tests.Integration\bin\Release\DNN.Integration.Test.Framework.dll" target="lib\"/>
<file src="Dnn.Platform\DNN Platform\Tests\DotNetNuke.Tests.Integration\bin\Release\DNN.Integration.Test.Framework.pdb" target="lib\"/>
<file src="Dnn.Platform\DNN Platform\Tests\DotNetNuke.Tests.Integration\bin\DNN.Integration.Test.Framework.dll" target="lib\"/>
<file src="Dnn.Platform\DNN Platform\Tests\DotNetNuke.Tests.Integration\bin\DNN.Integration.Test.Framework.pdb" target="lib\"/>
<file src="..\..\..\Build\Tools\NuGet\logo-for-nuget.png" target="images\"/>
</files>
</package>
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DNN.Integration.Test.Framework.Helpers
{
using System;
using System.Collections.Generic;
using System.Net;
using System.Security.Cryptography;
using System.Text;

using System.Threading.Tasks;

using DNN.Integration.Test.Framework.Controllers;
using NUnit.Framework;

public static class WebApiTestHelper
{
private static readonly Dictionary<string, IWebApiConnector> CachedConnections = new Dictionary<string, IWebApiConnector>();
private static readonly Random Rnd = new Random();
private static readonly string HostGuid = HostSettingsHelper.GetHostSettingValue("GUID");
private static IWebApiConnector _anonymousConnector;

/// <summary>Returns a coonector to access the default site annonymously.</summary>
/// <summary>Returns a connector to access the default site anonymously.</summary>
/// <returns>IWebApiConnector object to perform more actions.</returns>
public static IWebApiConnector GetAnnonymousConnector(string url = null)
{
Expand All @@ -45,28 +46,28 @@ SELECT TOP 1 m.ModuleID FROM {{objectQualifier}}TabModules tm
};
}

public static IWebApiConnector PrepareNewUser(out int userId, out string username, out int fileId, int portalId = 0)
public static async Task<(IWebApiConnector Connector, int UserId, string Username, int FileId)> PrepareNewUser(int portalId = 0)
{
username = $"testuser{Rnd.Next(1000, 9999)}";
var username = $"testuser{Rnd.Next(1000, 9999)}";
var email = $"{username}@dnn.com";

using (WebApiTestHelper.Register(username, AppConfigHelper.HostPassword, username, email))
{
}

userId = DatabaseHelper.ExecuteScalar<int>($"SELECT UserId FROM {{objectQualifier}}Users WHERE Username = '{username}'");
var userId = DatabaseHelper.ExecuteScalar<int>($"SELECT UserId FROM {{objectQualifier}}Users WHERE Username = '{username}'");

var connector = WebApiTestHelper.LoginHost();
var url = $"/API/PersonaBar/Users/UpdateAuthorizeStatus?userId={userId}&authorized=true";
connector.PostJson(url, new { });
connector.Logout();

var userConnector = WebApiTestHelper.LoginUser(username);
userConnector.UploadUserFile("Files\\Test.png", true, userId);
await userConnector.UploadUserFile("Files\\Test.png", true, userId);

fileId = DatabaseHelper.ExecuteScalar<int>($"SELECT MAX(FileId) FROM {{objectQualifier}}Files WHERE FileName = 'Test.png' AND CreatedByUserID = {userId} AND PortalId = {portalId}");
var fileId = DatabaseHelper.ExecuteScalar<int>($"SELECT MAX(FileId) FROM {{objectQualifier}}Files WHERE FileName = 'Test.png' AND CreatedByUserID = {userId} AND PortalId = {portalId}");

return userConnector;
return (userConnector, userId, username, fileId);
}

/// <summary>Register a user by using the Registration form.</summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace DNN.Integration.Test.Framework
{
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;

using System.Threading.Tasks;

public interface IWebApiConnector
{
int UserId { get; }
Expand All @@ -33,11 +34,11 @@ public interface IWebApiConnector

bool Login(string password);

HttpResponseMessage UploadUserFile(string fileName, bool waitHttpResponse = true, int userId = -1);
Task<HttpResponseMessage> UploadUserFile(string fileName, bool waitHttpResponse = true, int userId = -1);

HttpResponseMessage ActivityStreamUploadUserFile(IDictionary<string, string> headers, string fileName);

bool UploadCmsFile(string fileName, string portalFolder);
Task<bool> UploadCmsFile(string fileName, string portalFolder);

HttpResponseMessage PostJson(
string relativeUrl,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace DNN.Integration.Test.Framework
{
using System;
using System.Globalization;
using System.Net;
using System.Threading;

using System.Threading.Tasks;

using DNN.Integration.Test.Framework.Helpers;
using NUnit.Framework;

public abstract class IntegrationTestBase
{
// public static string DatabaseName { get; }
Expand Down Expand Up @@ -42,8 +43,9 @@ public static void LogText(string text)
}

[OneTimeSetUp]
public virtual void TestFixtureSetUp()
public virtual async Task TestFixtureSetUp()
{
await Task.Yield();
}

[OneTimeTearDown]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace DNN.Integration.Test.Framework
using System.Net.Http.Headers;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;
using System.Xml;
using System.Xml.Linq;
Expand Down Expand Up @@ -214,7 +215,10 @@ public bool Login(string password)
return this.IsLoggedIn;
}

public HttpResponseMessage UploadUserFile(string fileName, bool waitHttpResponse = true, int userId = -1)
public async Task<HttpResponseMessage> UploadUserFile(
string fileName,
bool waitHttpResponse = true,
int userId = -1)
{
this.EnsureLoggedIn();

Expand All @@ -226,7 +230,7 @@ public HttpResponseMessage UploadUserFile(string fileName, bool waitHttpResponse
folder = $"Users/{rootFolder}/{subFolder}/{userId}/";
}

return this.UploadFile(fileName, folder, waitHttpResponse);
return await this.UploadFile(fileName, folder, waitHttpResponse);
}

public HttpResponseMessage ActivityStreamUploadUserFile(IDictionary<string, string> headers, string fileName)
Expand All @@ -235,10 +239,10 @@ public HttpResponseMessage ActivityStreamUploadUserFile(IDictionary<string, stri
return this.ActivityStreamUploadFile(headers, fileName);
}

public bool UploadCmsFile(string fileName, string portalFolder)
public async Task<bool> UploadCmsFile(string fileName, string portalFolder)
{
this.EnsureLoggedIn();
var result = this.UploadFile(fileName, portalFolder);
var result = await this.UploadFile(fileName, portalFolder);
return result.IsSuccessStatusCode;
}

Expand Down Expand Up @@ -713,7 +717,7 @@ private void ExtractVerificationCookie(string cookiesString)
}
}

private HttpResponseMessage UploadFile(string fileName, string portalFolder, bool waitHttpResponse = true)
private async Task<HttpResponseMessage> UploadFile(string fileName, string portalFolder, bool waitHttpResponse = true)
{
using (var client = this.CreateHttpClient("/", true))
{
Expand All @@ -724,8 +728,8 @@ private HttpResponseMessage UploadFile(string fileName, string portalFolder, boo

if (string.IsNullOrEmpty(this._inputFieldVerificationToken))
{
var resultGet = client.GetAsync("/").Result;
var data = resultGet.Content.ReadAsStringAsync().Result;
var resultGet = await client.GetAsync("/");
var data = await resultGet.Content.ReadAsStringAsync();
this._inputFieldVerificationToken = GetVerificationToken(data);

if (!string.IsNullOrEmpty(this._inputFieldVerificationToken))
Expand Down Expand Up @@ -762,7 +766,7 @@ private HttpResponseMessage UploadFile(string fileName, string portalFolder, boo
content.Add(fileContent);

client.DefaultRequestHeaders.UserAgent.ParseAdd(this.UserAgentValue);
var result = client.PostAsync(UploadFileRequestPath, content).Result;
var result = await client.PostAsync(UploadFileRequestPath, content);
return !waitHttpResponse
? result
: EnsureSuccessResponse(result, "UploadFile", UploadFileRequestPath);
Expand Down
33 changes: 0 additions & 33 deletions DNN Platform/Tests/DNN.Integration.Test.Framework/packages.config

This file was deleted.

86 changes: 0 additions & 86 deletions DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/App.config

This file was deleted.

Loading