From e85a79e01cc98ac5e3c48ae971d86ac2b0aa5600 Mon Sep 17 00:00:00 2001
From: Owen Arnold <owen.arnold@stfc.ac.uk>
Date: Thu, 12 Nov 2015 18:29:18 +0000
Subject: [PATCH] refs #14124. Test optional bool mandatory.

---
 Framework/Kernel/test/PropertyManagerTest.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Framework/Kernel/test/PropertyManagerTest.h b/Framework/Kernel/test/PropertyManagerTest.h
index 9d08b3b8aed..7d4d37096ae 100644
--- a/Framework/Kernel/test/PropertyManagerTest.h
+++ b/Framework/Kernel/test/PropertyManagerTest.h
@@ -9,6 +9,7 @@
 #include "MantidKernel/MandatoryValidator.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/FilteredTimeSeriesProperty.h"
+#include "MantidKernel/OptionalBool.h"
 
 #include <boost/scoped_ptr.hpp>
 #include <json/json.h>
@@ -495,6 +496,22 @@ public:
                mgr.validateProperties());
   }
 
+  void test_optional_bool_property() {
+    PropertyManagerHelper mgr;
+
+    mgr.declareProperty(
+        new PropertyWithValue<OptionalBool>(
+            "PropertyX", OptionalBool::Unset,
+            boost::make_shared<MandatoryValidator<OptionalBool>>(),
+            Direction::Input),
+        "Custom property");
+
+    TSM_ASSERT("Mandatory validator unsatisified.", !mgr.validateProperties());
+    mgr.setProperty("PropertyX", OptionalBool(true));
+    TSM_ASSERT("Mandatory validator should be satisfied.",
+               mgr.validateProperties());
+  }
+
 private:
   PropertyManagerHelper *manager;
 };
-- 
GitLab