Skip to content

TempSensorReadingTests

Namespace: UnitTests.MqttReceiver

Unit tests for the TempSensorReading model, verifying JSON serialization and property behavior.

public class TempSensorReadingTests

Inheritance ObjectTempSensorReadingTests

Constructors

TempSensorReadingTests()

public TempSensorReadingTests()

Methods

DefaultValues_AreCorrect()

Tests that default property values are as expected.

public void DefaultValues_AreCorrect()

Deserialize_CompleteJson_ProducesCorrectObject()

Tests that a complete JSON string deserializes correctly to TempSensorReading.

public void Deserialize_CompleteJson_ProducesCorrectObject()

Deserialize_MinimalJson_ProducesCorrectObject()

Tests that a minimal JSON string deserializes correctly to TempSensorReading.

public void Deserialize_MinimalJson_ProducesCorrectObject()

Deserialize_NullMetaList_ConvertedToNull()

Tests that null meta list is handled by the NullMetaListConverter.

public void Deserialize_NullMetaList_ConvertedToNull()

Deserialize_NullValuesInArray_HandlesCorrectly()

Tests that null values in the value array are handled correctly.

public void Deserialize_NullValuesInArray_HandlesCorrectly()

Deserialize_TimestampAsNumber_ParsesCorrectly()

Tests that timestamp can be read from number format.

public void Deserialize_TimestampAsNumber_ParsesCorrectly()

Deserialize_TimestampAsString_ParsesCorrectly()

Tests that timestamp can be read from string format (JsonNumberHandling.AllowReadingFromString).

public void Deserialize_TimestampAsString_ParsesCorrectly()

Properties_SetAndGet_WorkCorrectly()

Tests that all properties can be set and retrieved correctly.

public void Properties_SetAndGet_WorkCorrectly()

Serialize_CompleteTempSensorReading_ProducesCorrectJson()

Tests that a complete TempSensorReading object serializes correctly to JSON.

public void Serialize_CompleteTempSensorReading_ProducesCorrectJson()

Serialize_MinimalTempSensorReading_ProducesCorrectJson()

Tests that a minimal TempSensorReading object serializes correctly to JSON.

public void Serialize_MinimalTempSensorReading_ProducesCorrectJson()

Setup()

Sets up test fixtures and initializes JSON serialization options.

public void Setup()