コード例 #1
0
        public void CompilerNull()
        {
            throw new AssertionException("Should Ignore");
            Stream stream = GetCSharpSample();

            CompilerAssert.Compiles(null, stream);
        }
コード例 #2
0
        public void CSharpStringCompiles()
        {
            Stream stream = GetCSharpSample();

            using (StreamReader sr = new StreamReader(stream))
            {
                CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, sr.ReadToEnd());
            }
        }
コード例 #3
0
        public void CSharpStringReferenceCollectionCompiles()
        {
            Stream stream = GetCSharpSample();

            using (StreamReader sr = new StreamReader(stream))
            {
                System.Collections.Specialized.StringCollection references = new System.Collections.Specialized.StringCollection();
                references.Add("System.dll");
                CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, references, sr.ReadToEnd());
            }
        }
コード例 #4
0
        public void CSharpStringCompilerParametersCompiles()
        {
            Stream stream = GetCSharpSample();

            using (StreamReader sr = new StreamReader(stream))
            {
                CompilerParameters options;
                string[]           assemblyNames = new string[] { "System.dll" };

                options = new CompilerParameters(assemblyNames, "CSharpStringCompilerParametersCompiles");
                CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, options, sr.ReadToEnd());

                options = new CompilerParameters(assemblyNames, "CSharpStringCompilerParametersCompiles", true);
                CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, options, sr.ReadToEnd());

                options = new CompilerParameters(assemblyNames, "CSharpStringCompilerParametersCompiles", false);
                CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, options, sr.ReadToEnd());
            }
        }
コード例 #5
0
        public void CSharpStreamCompilerParametersCompiles()
        {
            Stream stream;

            CompilerParameters options;

            string[] assemblyNames = new string[] { "System.dll" };

            stream  = GetCSharpSample();
            options = new CompilerParameters(assemblyNames, "CSharpStreamCompilerParametersCompiles");
            CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, options, stream);

            stream  = GetCSharpSample();
            options = new CompilerParameters(assemblyNames, "CSharpStreamCompilerParametersCompiles", true);
            CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, options, stream);

            stream  = GetCSharpSample();
            options = new CompilerParameters(assemblyNames, "CSharpStreamCompilerParametersCompiles", false);
            CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, options, stream);
        }
コード例 #6
0
        public void StreamNull()
        {
            Stream stream = null;

            CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, stream);
        }
コード例 #7
0
        public void CSharpStreamCompiles()
        {
            Stream stream = GetCSharpSample();

            CompilerAssert.Compiles(CompilerAssert.CSharpCompiler, stream);
        }
コード例 #8
0
        public void CompilerNull()
        {
            Stream stream = GetCSharpSample();

            CompilerAssert.Compiles(null, stream);
        }