コード例 #1
0
        public void GetHttpScriptInvocationContextValueTest_String()
        {
            string inputValue = "stringTest";
            object result     = ScriptInvocationContextExtensions.GetHttpScriptInvocationContextValue(inputValue);

            Assert.Equal($"\"{inputValue}\"", result);
        }
コード例 #2
0
        public void GetHttpScriptInvocationContextValueTest_POCO()
        {
            TestPoco inputValue = new TestPoco()
            {
                Name = "TestName",
                Id   = 1234
            };
            object result          = ScriptInvocationContextExtensions.GetHttpScriptInvocationContextValue(inputValue);
            var    resultAsJObject = (JObject)result;

            Assert.Equal("TestName", resultAsJObject["Name"]);
            Assert.Equal(1234, resultAsJObject["Id"]);
        }