Table of Contents

Class GroupedObservationServiceTest

Namespace
adas_core.Test.Services
Assembly
adas-core.Test.dll
[TestFixture]
public class GroupedObservationServiceTest
Inheritance
GroupedObservationServiceTest
Inherited Members
Extension Methods

Methods

Calculate_Last_Filled_Observations_should_add_Minus_1_hour_to_complete_last_five_hours()

Verifies that CalculateLastFilledObservations fills missing hourly entries in the last five hours, adding the -1 hour observation when it is not present in the provided list so that the returned collection always contains a complete five-hour window of last filled observations.

[Test]
public Task Calculate_Last_Filled_Observations_should_add_Minus_1_hour_to_complete_last_five_hours()

Returns

Task

Calculate_Last_Filled_Observations_should_add_Minus_4_hour_to_complete_last_five_hours()

Verifies that CalculateLastFilledObservations fills the missing hourly slot at now - 4 hours so that the returned sequence contains a complete set of five consecutive hourly observations (covering the last five hours relative to the current time) for a group with hourly regularity and a maximum of five entries.

[Test]
public Task Calculate_Last_Filled_Observations_should_add_Minus_4_hour_to_complete_last_five_hours()

Returns

Task

Calculate_Shift_Observations()

Verifies that the grouped observation service correctly calculates sum values for shift observations across multiple days and shift periods (08:00, 15:00, 22:00), including observations that fall within the current day, the previous day, and two days prior, ensuring that data is aggregated into the correct shift and day buckets.

[Test]
public void Calculate_Shift_Observations()

FillHoursObservations()

Verifies that the service correctly fills hourly observations from half-hour observation data, grouping timestamped values by hour and forwarding missing slots up to the configured maximum (5) per hour.

[Test]
public void FillHoursObservations()

Generate_Shift_Observations()

Tests that shift observations are correctly generated and grouped by shift time intervals (08:00, 15:00, 22:00) across multiple days, verifying the distribution of observations across shifts for the current day, the previous day, and two days prior when the Result.Last aggregation is applied with a maximum count of 36.

[Test]
public void Generate_Shift_Observations()

Setup()

Initializes the test fixture before each test by creating mocked dependencies (configuration observation service, observation repository, logger, and cache service) and instantiating the GroupedObservationService under test with default API and cache settings.

[SetUp]
public void Setup()