Example #1
0
        public void Should_infer_type()
        {
            var empty = Array.Empty <string>();
            var text  = "\"test\"";
            var value = VisualBasicDesignerHelper.CreatePrecompiledVisualBasicValue(null, text, empty, empty, null, out _, out _, out _);

            ((VisualBasicValue <string>)value).ExpressionText.ShouldBe(text);
            value = VisualBasicDesignerHelper.CreatePrecompiledVisualBasicValue(null, text, empty, empty, null, out _, out _, out _);
            ((VisualBasicValue <string>)value).ExpressionText.ShouldBe(text);
        }
Example #2
0
        private static void VbCompile(string text, Type resultType, string[] namespaces, string[] assemblies)
        {
            var value = VisualBasicDesignerHelper.CreatePrecompiledVisualBasicValue(null, text, namespaces, assemblies, null, out var returnType, out var compileError, out _);

            Check(text, resultType, value, returnType, compileError);
        }