Sha256: caf51887a74cb7b4a7859a82b236ea15438c41f2f40bcd72919d53d2e6d907f6

Contents?: true

Size: 955 Bytes

Versions: 37

Compression:

Stored size: 955 Bytes

Contents

#include "unity.h"
#include "Types.h"
#include "UsartConductor.h"
#include "MockUsartModel.h"
#include "MockUsartHardware.h"
#include "MockTaskScheduler.h"

void setUp(void)
{
}

void tearDown(void)
{
}

void testShouldInitializeHardwareWhenInitCalled(void)
{
  UsartModel_GetBaudRateRegisterSetting_ExpectAndReturn(4);
  UsartHardware_Init_Expect(4);
  UsartModel_GetWakeupMessage_ExpectAndReturn("Hey there!");
  UsartHardware_TransmitString_Expect("Hey there!");

  UsartConductor_Init();
}

void testRunShouldNotDoAnythingIfSchedulerSaysItIsNotTimeYet(void)
{
  TaskScheduler_DoUsart_ExpectAndReturn(FALSE);

  UsartConductor_Run();
}

void testRunShouldGetCurrentTemperatureAndTransmitIfSchedulerSaysItIsTime(void)
{
  TaskScheduler_DoUsart_ExpectAndReturn(TRUE);
  UsartModel_GetFormattedTemperature_ExpectAndReturn("hey there");
  UsartHardware_TransmitString_Expect("hey there");

  UsartConductor_Run();
}

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ceedling-0.29.1 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.29.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.19.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.18.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.17.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.16.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.15.6 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.15.5 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.15.4 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.15.3 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.15.2 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.15.1 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.15.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.13.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.13.0.rc1 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.12.2 examples/temp_sensor/test/test_UsartConductor.c
ceedling-0.12.1 examples/temp_sensor/test/test_UsartConductor.c
ceedling-0.12.0 examples/temp_sensor/test/test_UsartConductor.c
ceedling-0.11.2 examples/temp_sensor/test/test_UsartConductor.c
ceedling-0.11.1 examples/temp_sensor/test/test_UsartConductor.c