test: physical: Hit both branches of stableStateOperation()

Change-Id: Ic32d87dbe996a03e811e1be88fbcc00bf450e1f3
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/physical.hpp b/physical.hpp
index c8ef4fd..3d99066 100644
--- a/physical.hpp
+++ b/physical.hpp
@@ -13,10 +13,10 @@
 namespace led
 {
 /** @brief Assert LED by writing 255 */
-constexpr auto ASSERT = 255;
+constexpr unsigned long ASSERT = 255;
 
 /** @brief De-assert by writing "0" */
-constexpr auto DEASSERT = 0;
+constexpr unsigned long DEASSERT = 0;
 
 /** @class Physical
  *  @brief Responsible for applying actions on a particular physical LED
diff --git a/test/physical.cpp b/test/physical.cpp
index 9312598..f62caa2 100644
--- a/test/physical.cpp
+++ b/test/physical.cpp
@@ -66,6 +66,7 @@
     MOCK_METHOD1(setDelayOff, void(unsigned long ms));
 };
 
+using ::testing::InSequence;
 using ::testing::NiceMock;
 using ::testing::Return;
 using ::testing::Throw;
@@ -125,3 +126,20 @@
     EXPECT_CALL(led, getBrightness()).WillRepeatedly(Return(val));
     phosphor::led::Physical phy(bus, LED_OBJ, led);
 }
+
+TEST(Physical, on_to_off)
+{
+    InSequence s;
+
+    auto bus = sdbusplus::bus::new_default();
+    NiceMock<MockLed> led;
+    EXPECT_CALL(led, getTrigger()).Times(1).WillOnce(Return("none"));
+    constexpr auto deasserted = phosphor::led::DEASSERT;
+    EXPECT_CALL(led, getBrightness()).WillOnce(Return(deasserted));
+    constexpr auto asserted = phosphor::led::ASSERT;
+    EXPECT_CALL(led, setBrightness(asserted));
+    EXPECT_CALL(led, setBrightness(deasserted));
+    phosphor::led::Physical phy(bus, LED_OBJ, led);
+    phy.state(Action::On);
+    phy.state(Action::Off);
+}