Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 8 additions & 3 deletions tests/Opc.Ua.Server.Tests/DurableMonitoredItemTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Time.Testing;
using Moq;
using NUnit.Framework;
using Opc.Ua.Tests;
Expand Down Expand Up @@ -962,9 +963,10 @@ public void DataValueQueueSamplingIntervalOverwrites()
}

[Test]
public async Task DataValueQueueSamplingIntervalChangeAppliedAsync()
public Task DataValueQueueSamplingIntervalChangeAppliedAsync()
{
ITelemetryContext telemetry = NUnitTelemetryContext.Create();
var timeProvider = new FakeTimeProvider();

bool called = false;
void DiscardValueHandler() => called = true;
Expand All @@ -974,7 +976,8 @@ public async Task DataValueQueueSamplingIntervalChangeAppliedAsync()
false,
m_factory.Create(telemetry),
telemetry,
DiscardValueHandler);
DiscardValueHandler,
timeProvider);

queueHandler.SetQueueSize(3, true, DiagnosticsMasks.All);

Expand All @@ -988,7 +991,7 @@ public async Task DataValueQueueSamplingIntervalChangeAppliedAsync()
var statuscode2 = new ServiceResult(StatusCodes.Good);
var dataValue2 = new DataValue(new Variant(false));

await Task.Delay(5).ConfigureAwait(false);
timeProvider.Advance(TimeSpan.FromMilliseconds(2));

queueHandler.QueueValue(dataValue2, statuscode2);

Expand All @@ -1002,6 +1005,8 @@ public async Task DataValueQueueSamplingIntervalChangeAppliedAsync()
Assert.That(success, Is.True);
Assert.That(result, Is.EqualTo(dataValue));
Assert.That(resultError, Is.EqualTo(statuscode));

return Task.CompletedTask;
}

[Test]
Expand Down
682 changes: 681 additions & 1 deletion tests/Opc.Ua.SourceGeneration.Tests/ModelGeneratorTests.cs

Large diffs are not rendered by default.

Loading
Loading