Skip to content

TempServiceTests

Namespace: UnitTests.Services

Unit tests for the TempService class, verifying temperature operations.

public class TempServiceTests

Inheritance ObjectTempServiceTests

Constructors

TempServiceTests()

public TempServiceTests()

Methods

GetCoordinates_ApiErrorCode_ShouldNotInsert()

Tests that the GetCoordinate function does not insert anything if the api returns a message with an error code.

public Task GetCoordinates_ApiErrorCode_ShouldNotInsert()

Returns

Task

GetCoordinates_WhenExistingEntry_ShouldNotCallAPi()

Tests that the GetCoordinates function does not call the api when there is an entry in the database.

public Task GetCoordinates_WhenExistingEntry_ShouldNotCallAPi()

Returns

Task

GetCoordinates_WhenMissingFields_ShouldNotInsert()

Tests that the GetCoordinates function does not insert anything into the database, when there are missing fields in the JSON response.

public Task GetCoordinates_WhenMissingFields_ShouldNotInsert()

Returns

Task

GetCoordinates_WhenNoExistingEntry_ShouldCallApi()

Tests that the GetCoordinates function calls the api when there is no existing entry in the database.

public Task GetCoordinates_WhenNoExistingEntry_ShouldCallApi()

Returns

Task

Setup()

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

public void Setup()