Skip to content

NullMetaListConverterTests

Namespace: UnitTests.MqttReceiver

Unit tests for the NullMetaListConverter class, verifying JSON conversion logic for TempSensorReading lists.

public class NullMetaListConverterTests

Inheritance ObjectNullMetaListConverterTests

Constructors

NullMetaListConverterTests()

public NullMetaListConverterTests()

Methods

Read_ArrayWithMixedNullAndValidObjects_ReturnsArray()

Tests that an array with mixed null and valid objects is preserved.

public void Read_ArrayWithMixedNullAndValidObjects_ReturnsArray()

Read_ArrayWithOnlyNulls_ReturnsNull()

Tests that an array containing only null values is correctly converted to null.

public void Read_ArrayWithOnlyNulls_ReturnsNull()

Read_ArrayWithSingleValidObject_ReturnsArray()

Tests that a single valid object in an array is preserved.

public void Read_ArrayWithSingleValidObject_ReturnsArray()

Read_ArrayWithValidObjects_ReturnsArray()

Tests that an array with valid TempSensorReading objects is preserved.

public void Read_ArrayWithValidObjects_ReturnsArray()

Read_EmptyArray_ReturnsNull()

Tests that an empty JSON array is correctly converted to null.

public void Read_EmptyArray_ReturnsNull()

Read_NullJson_ReturnsNull()

Tests that a null JSON value is correctly converted to null.

public void Read_NullJson_ReturnsNull()

Setup()

Sets up test fixtures and initializes the converter with JSON options.

public void Setup()

Write_EmptyList_SerializesAsEmptyArray()

Tests that an empty list is correctly serialized as an empty array.

public void Write_EmptyList_SerializesAsEmptyArray()

Write_ListWithNullObjects_SerializesCorrectly()

Tests that a list with null objects is correctly serialized.

public void Write_ListWithNullObjects_SerializesCorrectly()

Write_ListWithValidObjects_SerializesCorrectly()

Tests that a list with valid objects is correctly serialized.

public void Write_ListWithValidObjects_SerializesCorrectly()

Write_NullList_SerializesAsNull()

Tests that a null list is correctly serialized as null.

public void Write_NullList_SerializesAsNull()