Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
2d07e23
Demo Mode (#258)
nkleiner Sep 30, 2026
1b96ffa
Updated release and beta release pipelines
nkleiner Sep 30, 2026
e469006
Fixing endpoint kestrel declarations
nkleiner Sep 30, 2026
0435885
Added protocol specifications
nkleiner Sep 30, 2026
da62751
Fixed a bug that caused demo mode popup to reappear on refreshing the…
nkleiner Oct 1, 2026
3ade7a5
Stopped remote devices from appearing (outside the demo remote device…
nkleiner Oct 1, 2026
7df8b69
Minor updates to the demo remote device
nkleiner Oct 1, 2026
a582beb
Minor modifications to the contents of the demo intro. Also removed t…
nkleiner Oct 1, 2026
85c92d1
Updated the analysis stop condition to work with the new objective ba…
nkleiner Oct 2, 2026
a9e6486
Added a plotly demo. Removed the old chart JS stuff
nkleiner Oct 5, 2026
f88ad85
Added the settings tab for planners to the planner allocation page
nkleiner Oct 6, 2026
dee51ff
Fixed a bug where floats and ints would appear as "Custom Value" when…
nkleiner Oct 6, 2026
98f525c
Updates to the pipelines to try and publish for both apple silicon an…
nkleiner Oct 6, 2026
cadb6f6
Fixed a seperation bug for the windows side. Added demo changes to th…
nkleiner Oct 6, 2026
1a73cd8
Pushing the missing interop.js file
nkleiner Oct 6, 2026
26c1572
Cleaned up the plotly.js file
nkleiner Oct 6, 2026
812bce3
Removed the unused plotly.js and kept the plotly-min.js file instead
nkleiner Oct 6, 2026
2ce7345
Initial commit with great progress towards visualization. Demo visual…
nkleiner Oct 8, 2026
814bbea
Further cleanup
nkleiner Oct 8, 2026
5ba1a57
Fixed an error that was preventing chart data from being saved to the…
nkleiner Oct 8, 2026
50b0183
Added some try-catch logic to prevent crashes if bad data in the data…
nkleiner Oct 9, 2026
7ae9e9f
Added a tab for viewing visualization data in the data viewer
nkleiner Oct 9, 2026
a5667d1
Signifigant improvements to the functionality of the data viewer page…
nkleiner Oct 9, 2026
d3ccc35
Fixing some problems in the plotly viewer
nkleiner Oct 9, 2026
72f675d
Fixed a bug in the value designer that caused some funniness in trans…
nkleiner Oct 12, 2026
90ab0ec
Working on updates to the SiLA data converter. Remoeved some commente…
nkleiner Oct 12, 2026
6cfbbbb
Fixed scripting. It was a missing ". Don't ask how long it took me to…
nkleiner Oct 12, 2026
09a1fc4
Updates to fix SiLA incompatabilities caused by complex custom types
nkleiner Oct 13, 2026
0286db6
Some more cleanup
nkleiner Oct 13, 2026
ebb5961
Added a new setting for using local time on campaign output folders
nkleiner Oct 13, 2026
2a570f9
Lots of updates towards final functionality for visualization in ARES…
nkleiner Oct 14, 2026
ce5e698
Updated migrations
nkleiner Oct 14, 2026
5770646
Updated release pipelines
nkleiner Oct 14, 2026
a48ab48
Changed the name of the log file
nkleiner Oct 14, 2026
8b9640f
Updated to latest datamodel
nkleiner Oct 14, 2026
fe40268
Forgot to swap datamodel package on the new visualizer demo
nkleiner Oct 14, 2026
f2ac9a1
Fixed an issue with emergency stop not stopping the campaigns as expe…
nkleiner Oct 19, 2026
bc82231
Fixed some of the responsiveness problems of the plotly charts on the…
nkleiner Oct 21, 2026
bfb915e
Fixed remote device not auto populating local host pre-fix into the c…
nkleiner Oct 21, 2026
c7eb0a1
Fixed the visual issues with the summary and output buttons on the sc…
nkleiner Oct 21, 2026
662da63
Added some additional logging to track the loading process more clear…
nkleiner Oct 22, 2026
81a1446
Re-worked some of the SiLA device infrastructure to fit our architect…
nkleiner Oct 25, 2026
d0f3884
Removed the old safemode test as it doesn't fit anymore
nkleiner Oct 25, 2026
f1a3141
Fixed a bug that caused experiments to be reset on the UI whenever th…
nkleiner Oct 25, 2026
28ad0b0
Fixed protection level issue for view model method
nkleiner Oct 25, 2026
f42e43e
Merge branch 'main' into Develop
nkleiner Oct 25, 2026
b30c8d4
Merge branch 'main' into Develop
nkleiner Oct 27, 2026
dd28d8f
Fixed a bug with the notification tab not returning to a default state
nkleiner Oct 27, 2026
b2d814f
Cleaned up the notification system with a refactor. Fixed a lot of wa…
nkleiner Oct 27, 2026
31b320d
Removed three apparently unused viewers
nkleiner Oct 27, 2026
e7c7497
Fixed a few references to the old analyzer result schema
nkleiner Oct 27, 2026
5ea5735
Updated the csproj files to include latest security patches causing w…
nkleiner Oct 27, 2026
1b78da6
Moved the typescript package version to match the one in use, address…
nkleiner Oct 27, 2026
d773b26
Finished off a bunch of warnings and messages.
nkleiner Oct 27, 2026
4256e2c
Fixed possible null reference of timestamps and made notification dis…
nkleiner Oct 28, 2026
29eaacd
Fixed scripting type hints to accept numbers broadly for other numeri…
nkleiner Oct 28, 2026
41e7a57
Fixed a few warnings and messages
nkleiner Oct 28, 2026
749afd7
Implemented the custom command dashboard widget
nkleiner Oct 28, 2026
f98256c
Fixed failing unit tests and spruced up the system settings page
nkleiner Oct 28, 2026
c75843d
Remote device user interface improvements (#282)
nkleiner Nov 9, 2026
7196de6
Good work towards a full wizard build up for templates, though not su…
nkleiner Nov 11, 2026
9d5fec2
Replacement drop down now provides all devices as options with the in…
nkleiner Nov 12, 2026
cabc214
More fixes to the wizard and additional adjustments to the feedback m…
nkleiner Nov 17, 2026
642885d
The custom command wizard is looking pretty solid now, but there is s…
nkleiner Nov 18, 2026
7189c4d
Fixed some of the reactivity errors and cleaned up the UI a little fu…
nkleiner Nov 18, 2026
f5e5181
Cleaned up the main layout and sidebar styling. Also fixed some probl…
nkleiner Nov 18, 2026
2ea4279
Cleaned up some styling and removed some redundant tool tips
nkleiner Nov 18, 2026
adff050
Updated migrations
nkleiner Nov 19, 2026
576997d
Updated datamodel version
nkleiner Nov 19, 2026
00c9aed
Cleanup
nkleiner Nov 19, 2026
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
6 changes: 3 additions & 3 deletions Ares.Core.Grpc/Ares.Core.Grpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<ItemGroup>
<PackageReference Include="Ares.Toolkit.Serial" Version="1.1.0" />
<PackageReference Include="DynamicData" Version="9.4.33" />
<PackageReference Include="Grpc.AspNetCore" Version="2.80.0" />
<PackageReference Include="Grpc.HealthCheck" Version="2.80.0" />
<PackageReference Include="DynamicData" Version="9.5.0" />
<PackageReference Include="Grpc.AspNetCore" Version="2.84.0" />
<PackageReference Include="Grpc.HealthCheck" Version="2.84.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="System.Reactive" Version="7.0.0" />
</ItemGroup>
Expand Down
11 changes: 2 additions & 9 deletions Ares.Core.Grpc/Services/AutomationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,6 @@ public override async Task<StartStopConditionsResponse> GetPreliminaryFailedStar
return response;
}

private async Task<IEnumerable<StartConditionResult>> GetFailedStartConditionResults()
{
var conditionTasks = _startConditions.Select(condition => condition.CanStart());
var conditions = await Task.WhenAll(conditionTasks);
return conditions;
}

public override Task<Empty> SetNumExperimentsStopCondition(NumExperimentsCondition request, ServerCallContext? context)
{
var stopConditions = _executionManager.CampaignStopConditions;
Expand Down Expand Up @@ -367,7 +360,7 @@ public override Task<Empty> AddAnalysisResultStopConditions(AddAnalysisResultCon
return Task.FromResult(new Empty());
}

public override Task<Empty> SetPlannerLeadStopCondition(Empty request, ServerCallContext context)
public override Task<Empty> SetPlannerLeadStopCondition(Empty request, ServerCallContext? context)
{
var stopConditions = _executionManager.CampaignStopConditions;

Expand Down Expand Up @@ -594,4 +587,4 @@ public async Task<IEnumerable<AnalyzerTransaction>> GetLatestAnalyzerTransaction

return await _analyzerTransactionProvider.GetAnalyzerTransactionsAsync(filter);
}
}
}
8 changes: 3 additions & 5 deletions Ares.Core.Grpc/Services/DevicesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ namespace Ares.Core.Grpc.Services;
public class DevicesService(
IAresDeviceProvider deviceProvider,
IDeviceDriverProvider driverProvider,
IDeviceConfigProvider configProvider,
IDeviceManager deviceManager,
IDeviceConfigManager deviceConfigManager,
IDbContextFactory<CoreDatabaseContext> contextFactory,
IRemoteDeviceManager remoteDeviceManager,
Expand Down Expand Up @@ -395,7 +393,7 @@ public override async Task<AddDeviceResponse> AddAresDevice(AddDeviceRequest req
}
}

public override async Task<RemoveDeviceResponse> RemoveAresDevice(RemoveDeviceRequest request, ServerCallContext context)
public override async Task<RemoveDeviceResponse> RemoveAresDevice(RemoveDeviceRequest request, ServerCallContext? context)
{
var response = new RemoveDeviceResponse();

Expand All @@ -414,7 +412,7 @@ public override async Task<RemoveDeviceResponse> RemoveAresDevice(RemoveDeviceRe
return response;
}

public override async Task<UpdateDeviceResponse> UpdateAresDevice(UpdateDeviceRequest request, ServerCallContext context)
public override async Task<UpdateDeviceResponse> UpdateAresDevice(UpdateDeviceRequest request, ServerCallContext? context)
{
var response = new UpdateDeviceResponse();

Expand Down Expand Up @@ -457,4 +455,4 @@ private async Task<DeviceInfo> GetInfo(IAresDevice device)

return info;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Ares.Core.Grpc.Services.Notifications;
public class AresNotificationService : AresNotificationRpc.AresNotificationRpcBase
{
private static readonly ConcurrentDictionary<string, IServerStreamWriter<AresNotification>> _clients = new();
private IAresNotificationRepo _notificationRepo;
private readonly IAresNotificationRepo _notificationRepo;

public AresNotificationService(IAresNotificationRepo notificationRepo)
{
Expand Down
16 changes: 8 additions & 8 deletions Ares.Core.Grpc/Services/VisualizerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public VisualizerService(IVisualizerRepo visualizerRepo, IRemoteVisualizerManage
_logger = logger;
}

public override async Task<GetAllVisualizersResponse> GetAllVisualizers(Empty request, ServerCallContext context)
public override async Task<GetAllVisualizersResponse> GetAllVisualizers(Empty request, ServerCallContext? context)
{
var response = new GetAllVisualizersResponse();
var infos = await Task.WhenAll(_visualizerRepo.AvailableVisualizers.Select(GetInfo));
response.Visualizers.AddRange(infos);
return response;
}

public override async Task<AddRemoteVisualizerResponse> AddRemoteVisualizer(AddRemoteVisualizerRequest request, ServerCallContext context)
public override async Task<AddRemoteVisualizerResponse> AddRemoteVisualizer(AddRemoteVisualizerRequest request, ServerCallContext? context)
{
try
{
Expand All @@ -51,7 +51,7 @@ public override async Task<AddRemoteVisualizerResponse> AddRemoteVisualizer(AddR
}
}

public override async Task<UpdateRemoteVisualizerResponse> UpdateRemoteVisualizer(UpdateRemoteVisualizerRequest request, ServerCallContext context)
public override async Task<UpdateRemoteVisualizerResponse> UpdateRemoteVisualizer(UpdateRemoteVisualizerRequest request, ServerCallContext? context)
{
try
{
Expand All @@ -72,13 +72,13 @@ public override async Task<UpdateRemoteVisualizerResponse> UpdateRemoteVisualize
}
}

public override async Task<Empty> RemoveRemoteVisualizer(RemoveRemoteVisualizerRequest request, ServerCallContext context)
public override async Task<Empty> RemoveRemoteVisualizer(RemoveRemoteVisualizerRequest request, ServerCallContext? context)
{
await _remoteVisualizerManager.RemoveVisualizer(request.VisualizerId);
return new Empty();
}

public override Task<StateResponse> GetState(StateRequest request, ServerCallContext context)
public override Task<StateResponse> GetState(StateRequest request, ServerCallContext? context)
{
var visualizer = _visualizerRepo.GetVisualizerById(request.Id);

Expand All @@ -99,7 +99,7 @@ public override Task<StateResponse> GetState(StateRequest request, ServerCallCon
});
}

public override async Task<VisualizerInfoResponse> GetInfo(VisualizerInfoRequest request, ServerCallContext context)
public override async Task<VisualizerInfoResponse> GetInfo(VisualizerInfoRequest request, ServerCallContext? context)
{
var visualizer = _visualizerRepo.GetVisualizerById(request.VisualizerId);
if(visualizer is null)
Expand All @@ -114,7 +114,7 @@ public override async Task<VisualizerInfoResponse> GetInfo(VisualizerInfoRequest
return new VisualizerInfoResponse { Info = await GetInfo(visualizer) };
}

public override Task<AresStruct> GetVisualizerSettings(VisualizerSettingsRequest request, ServerCallContext context)
public override Task<AresStruct> GetVisualizerSettings(VisualizerSettingsRequest request, ServerCallContext? context)
{
var visualizer = _visualizerRepo.GetVisualizerById(request.VisualizerId);

Expand Down Expand Up @@ -152,7 +152,7 @@ public async Task<AresStructSchema> GetVisualizerSettingsSchema(string visualize
return schema;
}

public override async Task<Empty> SetVisualizerSettings(VisualizerSettings request, ServerCallContext context)
public override async Task<Empty> SetVisualizerSettings(VisualizerSettings request, ServerCallContext? context)
{
if(_visualizerRepo.GetVisualizerById(request.VisualizerId) is not null)
await _remoteVisualizerManager.UpdateVisualizerSettings(request);
Expand Down
18 changes: 9 additions & 9 deletions Ares.Core.Tests/Ares.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Tools" Version="2.82.0">
<PackageReference Include="Grpc.Tools" Version="2.85.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.10" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.6.1" />
<PackageReference Include="NUnit3TestAdapter" Version="6.2.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.14.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.11.0" />
<PackageReference Include="Moq" Version="4.21.0" />
<PackageReference Include="NUnit" Version="5.0.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.3.1" />
<PackageReference Include="NUnit.Analyzers" Version="4.15.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="10.0.1">
<PackageReference Include="coverlet.collector" Version="10.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Microsoft.EntityFrameworkCore;
using Moq;
using Ares.Core.Execution.StopConditions.PlannerLead;
using Ares.Core.Campaigns.Models;

namespace Ares.Core.Tests.Campaigns;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ public async Task Delete_RemovesCompleteCampaignGraph()
public async Task Add_RejectsDuplicateCampaignName()
{
await _service.AddAsync(CreateCampaign("Duplicate"));

Assert.ThrowsAsync<DbUpdateException>(() => _service.AddAsync(CreateCampaign("Duplicate")));
await Assert.ThrowsAsync<DbUpdateException>(() => _service.AddAsync(CreateCampaign("Duplicate")));
}

private static CampaignTemplate CreateCampaign(string name)
Expand Down
59 changes: 49 additions & 10 deletions Ares.Core.Tests/Campaigns/CampaignTemplateTransferServiceTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using Ares.Core.Campaigns;
using Ares.Core.Campaigns.Helpers;
using Ares.Core.Campaigns.Models;
using Ares.Core.CustomCommands;
using Ares.Core.Device.Repos;
using Ares.Core.Device.Providers;
using Ares.Core.EntityConfigurations.Helpers;
using Ares.Datamodel;
using Ares.Datamodel.Device;
using Ares.Datamodel.Planning;
using Ares.Datamodel.Templates;
using Microsoft.Data.Sqlite;
Expand Down Expand Up @@ -31,12 +35,15 @@ public async Task SetUp()
_persistenceService = new CampaignTemplatePersistenceService(_contextFactory);
var customCommands = new Mock<ICustomCommandPersistenceService>();
customCommands.Setup(service => service.GetCommandsAsync()).ReturnsAsync([]);
var deviceRepo = new Mock<IAresDeviceRepo>();
deviceRepo.Setup(repo => repo.GetAll()).Returns([]);
var deviceProvider = new Mock<IAresDeviceProvider>();
deviceProvider.Setup(provider => provider.GetAllDevices()).Returns([]);
var deviceConfigProvider = new Mock<IDeviceConfigProvider>();
deviceConfigProvider.Setup(provider => provider.GetConfigByDeviceId(It.IsAny<string>())).Returns((Datamodel.Device.DeviceConfig)null);
_transferService = new CampaignTemplateTransferService(
_persistenceService,
customCommands.Object,
deviceRepo.Object,
deviceProvider.Object,
deviceConfigProvider.Object,
_contextFactory);
}

Expand Down Expand Up @@ -136,10 +143,10 @@ public async Task Import_ConvertsLegacyAresDeviceCommandToSystemCommand()
}

[Test]
public void Import_RejectsMalformedOrStructurallyInvalidFiles()
public async Task Import_RejectsMalformedOrStructurallyInvalidFiles()
{
Assert.ThrowsAsync<CampaignTemplateImportException>(() => _transferService.ImportAsync("not-json"));
Assert.ThrowsAsync<CampaignTemplateImportException>(() => _transferService.ImportAsync("{\"name\":\"Missing experiment\"}"));
await Assert.ThrowsAsync<CampaignTemplateImportException>(() => _transferService.ImportAsync("not-json"));
await Assert.ThrowsAsync<CampaignTemplateImportException>(() => _transferService.ImportAsync("{\"name\":\"Missing experiment\"}"));
}

[Test]
Expand All @@ -156,9 +163,41 @@ public async Task Import_PreservesMissingDeviceAndCustomReferencesWithWarnings()

var result = await _transferService.ImportAsync(export!.Json);

Assert.That(result.Warnings, Has.Some.Contains("pump-1"));
Assert.That(result.Warnings, Has.Some.Contains("missing-custom"));
Assert.That(result.Template.ExperimentTemplate.StepTemplates.Single().CommandTemplates, Has.Count.EqualTo(4));
using(Assert.EnterMultipleScope())
{
Assert.That(result.Warnings, Has.Some.Contains("pump-1"));
Assert.That(result.Warnings, Has.Some.Contains("missing-custom"));
Assert.That(result.Template.ExperimentTemplate.StepTemplates.Single().CommandTemplates, Has.Count.EqualTo(4));
}
}

[Test]
public void MatchDeviceCommand_RecognizesRenamedCommandWithMatchingInterface()
{
var requirement = new CampaignDeviceCommandDependency
{
CommandId = "set-speed",
Name = "Set Speed",
Parameters = [new ParameterMetadata { Name = "Speed", Schema = new AresValueSchema { Type = AresDataType.Number } }],
OutputSchema = new AresValueSchema { Type = AresDataType.Boolean },
Locations = []
};
var descriptor = new DeviceCommandDescriptor
{
Name = "Set Mix Speed",
InputSchema = new AresStructSchema(),
OutputSchema = new AresValueSchema { Type = AresDataType.Boolean }
};
descriptor.InputSchema.Fields["Speed"] = new AresValueSchema { Type = AresDataType.Number };

var match = CampaignTemplateHelper.MatchDeviceCommand(requirement, [descriptor]);

using(Assert.EnterMultipleScope())
{
Assert.That(match.Status, Is.EqualTo(CampaignCommandMatchStatus.Compatible));
Assert.That(match.CurrentName, Is.EqualTo("Set Mix Speed"));
Assert.That(match.Description, Does.Contain("interface matches"));
}
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public async Task GenerateAsync_SortsExperimentRowsAndCreatesFixedColumns()
var summary = CreateCampaignSummary(
summaryId,
"Campaign A",
CreateExperiment(secondStart, secondEnd, analysisResult: new List<Objective> { new Objective { ObjectiveName = "Result", ObjectiveValue = AresValueHelper.CreateNumber(2.5) } }),
CreateExperiment(firstStart, firstEnd, analysisResult: new List<Objective> { new Objective { ObjectiveName = "Result", ObjectiveValue = AresValueHelper.CreateNumber(1.5) } }));
CreateExperiment(secondStart, secondEnd, analysisResult: [new() { ObjectiveName = "Result", ObjectiveValue = AresValueHelper.CreateNumber(2.5) }]),
CreateExperiment(firstStart, firstEnd, analysisResult: [new() { ObjectiveName = "Result", ObjectiveValue = AresValueHelper.CreateNumber(1.5) }]));
var generator = CreateGenerator(summary);

var dataset = GetDataset(await generator.GenerateAsync(summaryId), "Experiments");
Expand Down Expand Up @@ -718,13 +718,13 @@ public async Task GenerateAsync_UsesAnySchemaForConflictingTransactionValues()
}

[Test]
public void GenerateAsync_ThrowsWhenAlreadyCanceled()
public async Task GenerateAsync_ThrowsWhenAlreadyCanceled()
{
using var cancellationTokenSource = new CancellationTokenSource();
cancellationTokenSource.Cancel();
var generator = new CampaignDatasetGenerator(CreateContextFactory());

Assert.ThrowsAsync<OperationCanceledException>(async () => await generator.GenerateAsync("summary-1", cancellationTokenSource.Token));
await Assert.ThrowsAsync<OperationCanceledException>(async () => await generator.GenerateAsync("summary-1", cancellationTokenSource.Token));
}

private static CampaignDatasetGenerator CreateGenerator(
Expand All @@ -744,7 +744,7 @@ private static CampaignDatasetGenerator CreateGenerator(
return new CampaignDatasetGenerator(CreateContextFactory(options));
}

private static IDbContextFactory<CoreDatabaseContext> CreateContextFactory(DbContextOptions<CoreDatabaseContext> options = null)
private static TestContextFactory CreateContextFactory(DbContextOptions<CoreDatabaseContext> options = null)
{
var contextOptions = options ?? CreateContextOptions();
return new TestContextFactory(contextOptions);
Expand Down Expand Up @@ -810,7 +810,7 @@ private static CampaignExecutionSummary CreateCampaignSummary(
private static ExperimentExecutionSummary CreateExperiment(
DateTime timeStarted,
DateTime timeFinished,
List<Objective>? analysisResult = null,
List<Objective> analysisResult = null,
(string Name, AresValue Value)[] resultFields = null,
Parameter[] parameters = null,
StepExecutionSummary[] steps = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,21 +464,20 @@ public async Task GenerateAsync_PreservesReservedDeviceFieldsUnderDataPrefix()
}

[Test]
public void GenerateAsync_ThrowsWhenAlreadyCanceled()
public async Task GenerateAsync_ThrowsWhenAlreadyCanceled()
{
var filter = new DeviceStateRequestFilter();
var stateGetter = new Mock<IDeviceStateGetter>();
using var cancellationTokenSource = new CancellationTokenSource();
cancellationTokenSource.Cancel();

var generator = CreateGenerator(stateGetter.Object);

Assert.ThrowsAsync<OperationCanceledException>(async () => await generator.GenerateAsync(filter, cancellationTokenSource.Token));
await Assert.ThrowsAsync<OperationCanceledException>(async () => await generator.GenerateAsync(filter, cancellationTokenSource.Token));
stateGetter.Verify(getter => getter.GetStates<DeviceState>(It.IsAny<DeviceStateRequestFilter>()), Times.Never);
}

[Test]
public void GenerateAsync_ThrowsWhenCanceledAfterFetchingStates()
public async Task GenerateAsync_ThrowsWhenCanceledAfterFetchingStates()
{
var filter = new DeviceStateRequestFilter();
var states = new Dictionary<string, DeviceState[]>
Expand All @@ -496,12 +495,11 @@ public void GenerateAsync_ThrowsWhenCanceledAfterFetchingStates()
});

var generator = CreateGenerator(stateGetter.Object);

Assert.ThrowsAsync<OperationCanceledException>(async () => await generator.GenerateAsync(filter, cancellationTokenSource.Token));
await Assert.ThrowsAsync<OperationCanceledException>(async () => await generator.GenerateAsync(filter, cancellationTokenSource.Token));
}

[Test]
public void GenerateAsync_WithMinimumSampleIntervalThrowsWhenCanceledDuringRowGeneration()
public async Task GenerateAsync_WithMinimumSampleIntervalThrowsWhenCanceledDuringRowGeneration()
{
var filter = new DeviceStateRequestFilter
{
Expand All @@ -519,8 +517,7 @@ public void GenerateAsync_WithMinimumSampleIntervalThrowsWhenCanceledDuringRowGe
using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMilliseconds(1));

var generator = CreateGenerator(stateGetter.Object);

Assert.ThrowsAsync<OperationCanceledException>(async () => await generator.GenerateAsync(filter, cancellationTokenSource.Token));
await Assert.ThrowsAsync<OperationCanceledException>(async () => await generator.GenerateAsync(filter, cancellationTokenSource.Token));
}

private static AresValueSchema ColumnSchema(AresDataset dataset, string columnName)
Expand Down
Loading
Loading