Example #1
0
        public void TryGetDynamicCodeOutput_InvalidCode_IsValidResult()
        {
            bool result;

            result = DynamicCodeExecutor.TryGetDynamicCodeOutput($"{TestDataTestHelper.GetString()}", out object returnedObject, out string warningText);
            Assert.IsFalse(result);
            Assert.IsNull(returnedObject);
            Assert.IsNotNull(warningText);
        }
Example #2
0
        public void TryGetDynamicCodeOutput_ValidCode_IsValidResult()
        {
            bool   result;
            string testText;

            testText = TestDataTestHelper.GetString();
            result   = DynamicCodeExecutor.TryGetDynamicCodeOutput($"\"{testText}\"", out object returnedObject, out string warningText);
            Assert.IsTrue(result);
            Assert.IsNotNull(returnedObject);
            Assert.IsNull(warningText);
            Assert.IsInstanceOfType(returnedObject, typeof(string));
            Assert.AreEqual(returnedObject.ToString(), testText);
        }