Sha256: 593a4c65e0052d131811fbcef7922887292d9e130da3d0e1a037bd644efeceac

Contents?: true

Size: 915 Bytes

Versions: 13

Compression:

Stored size: 915 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

13 entries across 13 versions & 1 rubygems

Version Path
ceedling-0.31.1 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.31.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.30.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.28.3 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.28.2 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.28.1 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.27.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.25.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.24.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.22.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.21.0 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.20.3 examples/temp_sensor/test/TestUsartConductor.c
ceedling-0.20.2 examples/temp_sensor/test/TestUsartConductor.c