Sha256: b3b05e87ac62d463ef489eb2e8aca41d2b6829ef8edaab27622c9c4889a59dba
Contents?: true
Size: 1.02 KB
Versions: 27
Compression:
Stored size: 1.02 KB
Contents
#include "unity.h" #include "Types.h" #include "AdcHardware.h" #include "MockAdcHardwareConfigurator.h" #include "MockAdcTemperatureSensor.h" void setUp(void) { } void tearDown(void) { } void testInitShouldDelegateToConfiguratorAndTemperatureSensor(void) { Adc_Reset_Expect(); Adc_ConfigureMode_Expect(); Adc_EnableTemperatureChannel_Expect(); Adc_StartTemperatureSensorConversion_Expect(); AdcHardware_Init(); } void testGetSampleCompleteShouldReturn_FALSE_WhenTemperatureSensorSampleReadyReturns_FALSE(void) { Adc_TemperatureSensorSampleReady_ExpectAndReturn(FALSE); TEST_ASSERT(!AdcHardware_GetSampleComplete()); } void testGetSampleCompleteShouldReturn_TRUE_WhenTemperatureSensorSampleReadyReturns_TRUE(void) { Adc_TemperatureSensorSampleReady_ExpectAndReturn(TRUE); TEST_ASSERT(AdcHardware_GetSampleComplete()); } void testGetSampleShouldDelegateToAdcTemperatureSensor(void) { uint16 sample; Adc_ReadTemperatureSensor_ExpectAndReturn(847); sample = AdcHardware_GetSample(); TEST_ASSERT_EQUAL(847, sample); }
Version data entries
27 entries across 14 versions & 1 rubygems