StatisticsUnitTests.cs 705 B

1234567891011121314151617181920212223242526
  1. using Xunit;
  2. using analyzeJSON;
  3. using Newtonsoft.Json.Linq;
  4. namespace analyzeJSONTests
  5. {
  6. public class StatisticsUnitTests
  7. {
  8. [Fact]
  9. public void RunStatistics_AllGood()
  10. {
  11. dynamic token = new JObject();
  12. token.one = "Lorem ipsum dolor";
  13. token.two = "Lorem ipsum dolor";
  14. token.three = "Lorem\nipsum dolor";
  15. var stats = new Statistics();
  16. stats.RunStatistics(token.one);
  17. stats.RunStatistics(token.two);
  18. stats.RunStatistics(token.three);
  19. Assert.Equal(3, stats.Result.NodeCounts.Count);
  20. Assert.Equal(9, stats.Result.TotalWordCount);
  21. }
  22. }
  23. }