예제 #1
0
        public void PreventSetters_Test()
        {
            var p = new StringConversionParameter();

            Assert.ThrowsException <InvalidOperationException>(() => p.Stream    = new MemoryStream());
            Assert.ThrowsException <InvalidOperationException>(() => p.AutoFlush = true);
        }
예제 #2
0
        public void StringConversionParameter_Test()
        {
            var p = new StringConversionParameter();

            Assert.IsInstanceOfType(p.Stream, typeof(MemoryStream));
            Assert.IsFalse(p.AutoFlush);
            Assert.IsNotNull(p.AdditionalPlugins);
        }
예제 #3
0
        //[Benchmark]
        public string RenderShortest()
        {
            var p = new StringConversionParameter {
                Elements = _shortestParagraph
            };

            _conversionEngine.Convert(p);
            return(p.GetResult());
        }
예제 #4
0
        public void GetResult_Test()
        {
            var p       = new StringConversionParameter();
            var writter = new StreamWriter(p.Stream);

            writter.Write("test");
            writter.Flush();
            var r = p.GetResult();

            Assert.AreEqual("test", r);
        }
예제 #5
0
        public string RenderAll()
        {
            var p = new StringConversionParameter
            {
                Elements = _elements,
                Parallel = true
            };

            _conversionEngine.Convert(p);
            return(p.GetResult());
        }
예제 #6
0
        public string RenderAllCamelCase()
        {
            var p = new StringConversionParameter
            {
                Elements = _elements,
                Parallel = true,
            };

            p.AdditionalPlugins.Add(new CamelCasePlugin());
            _conversionEngine.Convert(p);
            return(p.GetResult());
        }