diff --git a/tests/unit-tests/util/scheduler.t.cpp b/tests/unit-tests/util/scheduler.t.cpp
index de54800..05380f3 100644
--- a/tests/unit-tests/util/scheduler.t.cpp
+++ b/tests/unit-tests/util/scheduler.t.cpp
@@ -24,6 +24,7 @@
 
 #include "boost-test.hpp"
 #include "../unit-test-time-fixture.hpp"
+
 #include <boost/lexical_cast.hpp>
 
 namespace ndn {
@@ -253,9 +254,9 @@
 {
   EventId eid;
   eid = nullptr;
+  EventId eid2(nullptr);
 
-  // avoid "test case [...] did not check any assertions" message from Boost.Test
-  BOOST_CHECK(true);
+  BOOST_CHECK(!eid && !eid2);
 }
 
 BOOST_AUTO_TEST_CASE(Compare)
@@ -273,12 +274,12 @@
   BOOST_CHECK_EQUAL(eid != nullptr, true);
 
   eid2 = eid;
-  BOOST_CHECK_EQUAL(eid == eid2, true);
+  BOOST_CHECK_EQUAL(eid, eid2);
   BOOST_CHECK_EQUAL(eid != eid2, false);
 
   eid2 = scheduler.scheduleEvent(10_ms, []{});
   BOOST_CHECK_EQUAL(eid == eid2, false);
-  BOOST_CHECK_EQUAL(eid != eid2, true);
+  BOOST_CHECK_NE(eid, eid2);
 }
 
 BOOST_AUTO_TEST_CASE(Valid)
@@ -293,10 +294,8 @@
 
   EventId eid2 = eid;
   scheduler.cancelEvent(eid2);
-  BOOST_CHECK_EQUAL(static_cast<bool>(eid), false);
-  BOOST_CHECK_EQUAL(!eid, true);
-  BOOST_CHECK_EQUAL(static_cast<bool>(eid2), false);
-  BOOST_CHECK_EQUAL(!eid2, true);
+  BOOST_CHECK(!eid);
+  BOOST_CHECK(!eid2);
 }
 
 BOOST_AUTO_TEST_CASE(DuringCallback)
@@ -309,17 +308,14 @@
     isCallbackInvoked = true;
 
     // eid is "expired" during callback execution
-    BOOST_CHECK_EQUAL(static_cast<bool>(eid), false);
-    BOOST_CHECK_EQUAL(!eid, true);
-    BOOST_CHECK_EQUAL(eid == eid2, false);
-    BOOST_CHECK_EQUAL(eid != eid2, true);
-    BOOST_CHECK_EQUAL(eid == nullptr, true);
-    BOOST_CHECK_EQUAL(eid != nullptr, false);
+    BOOST_CHECK(!eid);
+    BOOST_CHECK(eid == nullptr);
+    BOOST_CHECK_NE(eid, eid2);
 
     scheduler.cancelEvent(eid2);
-    BOOST_CHECK_EQUAL(eid == eid2, true);
-    BOOST_CHECK_EQUAL(eid != eid2, false);
+    BOOST_CHECK_EQUAL(eid, eid2);
   });
+
   this->advanceClocks(6_ms, 2);
   BOOST_CHECK(isCallbackInvoked);
 }
@@ -327,11 +323,10 @@
 BOOST_AUTO_TEST_CASE(Reset)
 {
   bool isCallbackInvoked = false;
-  EventId eid = scheduler.scheduleEvent(10_ms,
-                                        [&isCallbackInvoked]{ isCallbackInvoked = true; });
+  EventId eid = scheduler.scheduleEvent(10_ms, [&isCallbackInvoked] { isCallbackInvoked = true; });
   eid.reset();
-  BOOST_CHECK_EQUAL(!eid, true);
-  BOOST_CHECK_EQUAL(eid == nullptr, true);
+  BOOST_CHECK(!eid);
+  BOOST_CHECK(eid == nullptr);
 
   this->advanceClocks(6_ms, 2);
   BOOST_CHECK(isCallbackInvoked);
@@ -392,14 +387,23 @@
 BOOST_AUTO_TEST_CASE(Move)
 {
   int hit = 0;
-  unique_ptr<scheduler::ScopedEventId> se2;
+  unique_ptr<ScopedEventId> se2;
   {
     ScopedEventId se(scheduler);
     se = scheduler.scheduleEvent(10_ms, [&] { ++hit; });
-    se2.reset(new ScopedEventId(std::move(se)));
+    se2 = make_unique<ScopedEventId>(std::move(se)); // move constructor
   } // se goes out of scope
   this->advanceClocks(1_ms, 15);
   BOOST_CHECK_EQUAL(hit, 1);
+
+  ScopedEventId se3(scheduler);
+  {
+    ScopedEventId se(scheduler);
+    se = scheduler.scheduleEvent(10_ms, [&] { ++hit; });
+    se3 = std::move(se); // move assignment
+  } // se goes out of scope
+  this->advanceClocks(1_ms, 15);
+  BOOST_CHECK_EQUAL(hit, 2);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // ScopedEventId
diff --git a/tests/unit-tests/util/signal.t.cpp b/tests/unit-tests/util/signal.t.cpp
index 70ab22f..c319f64 100644
--- a/tests/unit-tests/util/signal.t.cpp
+++ b/tests/unit-tests/util/signal.t.cpp
@@ -289,9 +289,9 @@
 BOOST_AUTO_TEST_CASE(AutoDisconnectMove)
 {
   SignalOwner0 so;
-  unique_ptr<ScopedConnection> sc2;
-
   int hit = 0;
+
+  unique_ptr<ScopedConnection> sc2;
   {
     ScopedConnection sc = so.sig.connect([&hit] { ++hit; });
 
@@ -299,15 +299,35 @@
     BOOST_CHECK_EQUAL(hit, 1); // handler called
     BOOST_CHECK_EQUAL(sc.isConnected(), true);
 
-    sc2.reset(new ScopedConnection(std::move(sc)));
+    sc2 = make_unique<ScopedConnection>(std::move(sc)); // move constructor
     BOOST_CHECK_EQUAL(sc.isConnected(), false);
     BOOST_CHECK_EQUAL(sc2->isConnected(), true);
 
-    // sc goes out of scope, but not disconnecting
+    // sc goes out of scope, but without disconnecting
   }
 
   so.emitSignal(sig);
   BOOST_CHECK_EQUAL(hit, 2); // handler called
+  sc2.reset();
+
+  ScopedConnection sc3;
+  {
+    ScopedConnection sc = so.sig.connect([&hit] { ++hit; });
+
+    so.emitSignal(sig);
+    BOOST_CHECK_EQUAL(hit, 3); // handler called
+    BOOST_CHECK_EQUAL(sc.isConnected(), true);
+    BOOST_CHECK_EQUAL(sc3.isConnected(), false);
+
+    sc3 = std::move(sc); // move assignment
+    BOOST_CHECK_EQUAL(sc.isConnected(), false);
+    BOOST_CHECK_EQUAL(sc3.isConnected(), true);
+
+    // sc goes out of scope, but without disconnecting
+  }
+
+  so.emitSignal(sig);
+  BOOST_CHECK_EQUAL(hit, 4); // handler called
 }
 
 BOOST_AUTO_TEST_CASE(ConnectSingleShot)
