-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDMS-155 allows finalisedOnly to be passed to analytics endpoints to …
…filter on only those that have been finalised
- Loading branch information
1 parent
d41fe63
commit 32a0141
Showing
13 changed files
with
100 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Btms.Common.Extensions; | ||
using FluentAssertions; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
using Btms.Analytics.Tests.Fixtures; | ||
using Btms.Analytics.Tests.Helpers; | ||
using TestDataGenerator.Config; | ||
using TestDataGenerator.Scenarios; | ||
using TestDataGenerator.Scenarios.SpecificFiles; | ||
using TestGenerator.IntegrationTesting.Backend; | ||
using TestGenerator.IntegrationTesting.Backend.Extensions; | ||
using TestGenerator.IntegrationTesting.Backend.Fixtures; | ||
|
||
namespace Btms.Analytics.Tests; | ||
|
||
public class FinalisedOnlyTests(ITestOutputHelper output) : MultipleScenarioGeneratorBaseTest(output) | ||
{ | ||
[Theory] | ||
[InlineData(typeof(Mrn24GBDDJER3ZFRMZAR9ScenarioGenerator), false, true)] | ||
[InlineData(typeof(Mrn24GBDDJER3ZFRMZAR9ScenarioGenerator), true, false)] | ||
public async Task ShouldReturnCorrectAggregation(Type generatorType, bool finalisedOnly, bool returnsResults) | ||
{ | ||
EnsureEnvironmentInitialised(generatorType); | ||
|
||
var result = await Client | ||
.GetAnalyticsDashboard(["decisionsByDecisionCode"], | ||
dateFrom: DateTime.MinValue, dateTo: DateTime.MaxValue, | ||
finalisedOnly: finalisedOnly); | ||
|
||
var chart = await result | ||
.AnalyticsChartAs<SummarisedDataset<SingleSeriesDataset, StringBucketDimensionResult>>("decisionsByDecisionCode")!; | ||
|
||
chart.Summary.Values.Count | ||
.Should().Be(returnsResults ? 1 : 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.