From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001
From: chai <chaifix@163.com>
Date: Wed, 14 Aug 2019 22:50:43 +0800
Subject: +Unity Runtime code

---
 Runtime/IMGUI/GUIContentTests.cpp | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Runtime/IMGUI/GUIContentTests.cpp

(limited to 'Runtime/IMGUI/GUIContentTests.cpp')

diff --git a/Runtime/IMGUI/GUIContentTests.cpp b/Runtime/IMGUI/GUIContentTests.cpp
new file mode 100644
index 0000000..4f45a64
--- /dev/null
+++ b/Runtime/IMGUI/GUIContentTests.cpp
@@ -0,0 +1,28 @@
+#include "UnityPrefix.h"
+
+#if ENABLE_UNIT_TESTS
+
+#include "External/UnitTest++/src/UnitTest++.h"
+#include "Runtime/IMGUI/GUIContent.h"
+#include "Runtime/Testing/TestFixtures.h"
+#include "Runtime/Testing/Testing.h"
+
+SUITE (GUIContentTests)
+{
+	typedef TestFixtureBase Fixture;
+
+	TEST_FIXTURE (Fixture, NullContentDoesNotCrash)
+	{
+		//Set expectations.
+		EXPECT (Warning, "GUIContent is null. Use GUIContent.none.");
+
+		// Do.
+		GUIContent content = MonoGUIContentToTempNative (SCRIPTING_NULL);
+		
+		// Assert.
+		CHECK ((UTF16String)"" == content.m_Text);
+		CHECK ((UTF16String)"" == content.m_Tooltip);
+		CHECK (content.m_Image.IsNull());
+	}
+}
+#endif 
-- 
cgit v1.1-26-g67d0