Skip to content

Commit 548882e

Browse files
Fix unit tests: use supported DataPortalResult constructor with ApplicationContext
Co-authored-by: rockfordlhotka <2333134+rockfordlhotka@users.noreply.github.com>
1 parent 8ea5d25 commit 548882e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Source/tests/Csla.test/DataPortal/OpenTelemetryDashboardTests.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@
33
using System.Diagnostics.Metrics;
44
using Csla.Server;
55
using Csla.Server.Dashboard;
6+
using Csla.TestHelpers;
67
using Microsoft.VisualStudio.TestTools.UnitTesting;
78

89
namespace Csla.Test.DataPortal
910
{
1011
[TestClass]
1112
public class OpenTelemetryDashboardTests
1213
{
14+
private static TestDIContext _testDIContext;
15+
16+
[ClassInitialize]
17+
public static void ClassInitialize(TestContext context)
18+
{
19+
_testDIContext = TestDIContextFactory.CreateDefaultContext();
20+
}
1321
[TestMethod]
1422
public void OpenTelemetryDashboard_CanInstantiate()
1523
{
@@ -45,7 +53,8 @@ public void OpenTelemetryDashboard_TracksCompleteCall_Success()
4553
{
4654
// Arrange
4755
using var dashboard = new OpenTelemetryDashboard();
48-
var result = new DataPortalResult();
56+
var applicationContext = _testDIContext.CreateTestApplicationContext();
57+
var result = new Server.DataPortalResult(applicationContext);
4958
var args = new InterceptArgs(
5059
typeof(string),
5160
null,
@@ -107,6 +116,7 @@ public void OpenTelemetryDashboard_MultipleCallsTracked()
107116
{
108117
// Arrange
109118
using var dashboard = new OpenTelemetryDashboard();
119+
var applicationContext = _testDIContext.CreateTestApplicationContext();
110120

111121
// Act - Initialize multiple calls
112122
for (int i = 0; i < 5; i++)
@@ -122,7 +132,7 @@ public void OpenTelemetryDashboard_MultipleCallsTracked()
122132
// Complete 3 successfully
123133
for (int i = 0; i < 3; i++)
124134
{
125-
var result = new DataPortalResult();
135+
var result = new Server.DataPortalResult(applicationContext);
126136
var completeArgs = new InterceptArgs(
127137
typeof(string),
128138
null,

0 commit comments

Comments
 (0)