public void ShouldReturnAllDefaultDiacritics() { // Arrange var stopwatch = new Stopwatch(); stopwatch.Start(); var defaultDiacriticsMapper = new DefaultDiacriticsMapper(); // Act var defaultDiacriticsMapping = defaultDiacriticsMapper.ToList(); stopwatch.Stop(); // Assert defaultDiacriticsMapping.Should().HaveCount(107); this.testOutputHelper.WriteLine("stopwatch.ElapsedMilliseconds = {0}ms", stopwatch.ElapsedMilliseconds); //stopwatch.ElapsedMilliseconds.Should().BeLessThan(100); }
public void ShouldMeasurePerformanceOfRemoveDiacritics(int count, char c) { // Arrange var input = new string(c, count); var defaultDiacriticsMapper = new DefaultDiacriticsMapper(); var stopwatch = new Stopwatch(); // Act stopwatch.Start(); var defaultDiacriticsMapping = defaultDiacriticsMapper.RemoveDiacritics(input); stopwatch.Stop(); // Assert this.testOutputHelper.WriteLine($"input.Length = {input.Length}"); this.testOutputHelper.WriteLine($"stopwatch.ElapsedMilliseconds = {stopwatch.ElapsedMilliseconds}ms"); this.testOutputHelper.WriteLine($"stopwatch.ElapsedTicks = {stopwatch.ElapsedTicks}"); defaultDiacriticsMapping.HasDiacritics().Should().BeFalse(); }