InfluxRepoTests¶
Namespace: UnitTests.Repositories
Unit tests for the InfluxRepo class, verifying InfluxDB repository operations including data writing and querying functionality.
Inheritance Object → InfluxRepoTests
Constructors¶
InfluxRepoTests()¶
Methods¶
Constructor_WithEnvironmentVariableHost_ShouldCreateInstance()¶
Tests that the constructor creates a valid instance when InfluxDB host is provided via environment variable.
Constructor_WithEnvironmentVariableToken_ShouldCreateInstance()¶
Tests that the constructor creates a valid instance when InfluxDB token is provided via environment variable.
Constructor_WithMissingHost_ShouldThrowArgumentException()¶
Tests that the constructor throws ArgumentException when InfluxDB host is missing from configuration.
Constructor_WithMissingToken_ShouldThrowArgumentException()¶
Tests that the constructor throws ArgumentException when InfluxDB token is missing from configuration.
Constructor_WithNullLogger_ShouldThrowArgumentNullException()¶
Tests that the constructor throws ArgumentNullException when logger parameter is null.
Constructor_WithValidConfiguration_ShouldCreateInstance()¶
Tests that the constructor creates a valid instance when provided with valid configuration.
GetOutsideWeatherData_WithException_ShouldLogErrorAndRethrow()¶
Tests that GetOutsideWeatherData logs error and rethrows exception when an error occurs.
Returns¶
GetSensorWeatherData_WithException_ShouldLogErrorAndRethrow()¶
Tests that GetSensorWeatherData logs error and rethrows exception when an error occurs.
Returns¶
GetSensorWeatherData_WithValidParameters_ShouldGenerateCorrectQuery()¶
Tests that GetSensorWeatherData with valid parameters generates the correct InfluxDB query.
Returns¶
Setup()¶
Sets up test fixtures and initializes mocks before each test execution.
WriteOutsideWeatherData_TemperatureConversion_ShouldConvertCelsiusToFahrenheitCorrectly()¶
Tests that WriteOutsideWeatherData correctly converts temperature from Celsius to Fahrenheit.
public void WriteOutsideWeatherData_TemperatureConversion_ShouldConvertCelsiusToFahrenheitCorrectly()
WriteSensorData_TimestampConversion_ShouldConvertUnixTimestampCorrectly()¶
Tests that WriteSensorData correctly converts Unix timestamp to proper DateTime format.
WriteSensorData_WithValidData_ShouldWritePointCorrectly()¶
Tests that WriteSensorData with valid data writes the point correctly to InfluxDB.