public void PerformanceTest() { var parser = new XAMLFileParser(); var sw = new Stopwatch(); sw.Start(); for (int i = 0; i < 100; i++) { parser.Parse(filePath); } sw.Stop(); Assert.IsTrue(sw.Elapsed.TotalSeconds < 50); }
public void TestLengthOfEachXamlElement() { var parser = new XAMLFileParser(); var elements = parser.Parse(filePath); var sb = new StringBuilder(); foreach (var element in elements) { sb.AppendLine(element.RawSource); sb.AppendLine("===================================================="); Assert.IsTrue(element.RawSource.Split(new string[]{Environment.NewLine}, StringSplitOptions.None).Count() <= XAMLFileParser.LengthLimit); } }
public void PerformanceTest() { var parser = new XAMLFileParser(); var sw = new Stopwatch(); sw.Start(); for (int i = 0; i < 100; i++) { parser.Parse(filePath); } sw.Stop(); Assert.IsTrue(sw.Elapsed.TotalSeconds < 50); }
public void TestLengthOfEachXamlElement() { var parser = new XAMLFileParser(); var elements = parser.Parse(filePath); var sb = new StringBuilder(); foreach (var element in elements) { sb.AppendLine(element.RawSource); sb.AppendLine("===================================================="); Assert.IsTrue(element.RawSource.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).Count() <= XAMLFileParser.LengthLimit); } }