Skip to content

TemperatureDataControllerTests

Namespace: UnitTests.Controllers

Unit tests for the TemperatureDataController class, verifying temperature data retrieval and formatting functionality.

public class TemperatureDataControllerTests

Inheritance ObjectTemperatureDataControllerTests

Constructors

TemperatureDataControllerTests()

public TemperatureDataControllerTests()

Methods

Constructor_WithNullInfluxRepo_ShouldThrowArgumentNullException()

Tests that the constructor throws ArgumentNullException when InfluxDB repository parameter is null.

public void Constructor_WithNullInfluxRepo_ShouldThrowArgumentNullException()

Constructor_WithNullLogger_ShouldThrowArgumentNullException()

Tests that the constructor throws ArgumentNullException when logger parameter is null.

public void Constructor_WithNullLogger_ShouldThrowArgumentNullException()

Constructor_WithNullSettingsRepo_ShouldThrowArgumentNullException()

Tests that the constructor throws ArgumentNullException when settings repository parameter is null.

public void Constructor_WithNullSettingsRepo_ShouldThrowArgumentNullException()

Constructor_WithValidParameters_ShouldCreateInstance()

Tests that the constructor creates a valid instance when provided with valid parameters.

public void Constructor_WithValidParameters_ShouldCreateInstance()

ConvertToFahrenheit_WithCelsiusValues_ShouldReturnCorrectFahrenheitValues()

Tests that ConvertToFahrenheit method correctly converts Celsius values to Fahrenheit.

public void ConvertToFahrenheit_WithCelsiusValues_ShouldReturnCorrectFahrenheitValues()

DateFormatting_ShouldFormatCorrectly()

Tests that date formatting produces correctly formatted date strings.

public void DateFormatting_ShouldFormatCorrectly()

GetTemperature_WithFahrenheitConversion_ShouldReturnConvertedTemperatures()

Tests that GetTemperature with Fahrenheit conversion returns temperatures converted from Celsius to Fahrenheit.

public Task GetTemperature_WithFahrenheitConversion_ShouldReturnConvertedTemperatures()

Returns

Task

GetTemperature_WithNoSensorSettings_ShouldHandleGracefully()

Tests that GetTemperature handles gracefully when no sensor settings are available.

public Task GetTemperature_WithNoSensorSettings_ShouldHandleGracefully()

Returns

Task

GetTemperature_WithValidParameters_ShouldReturnOkWithTemperatureData()

Tests that GetTemperature with valid parameters returns an OK result with temperature data.

public Task GetTemperature_WithValidParameters_ShouldReturnOkWithTemperatureData()

Returns

Task

Setup()

Sets up test fixtures and initializes mocks before each test execution.

public void Setup()