PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/Reporting/Machine.Specifications.Reporting.Specs/Generation/SpecificationTreeListenerSpecs.cs

https://github.com/machine/machine.specifications
C# | 40 lines | 30 code | 10 blank | 0 comment | 0 complexity | 3e4d22d74d0d7616acc0980da99a40ae MD5 | raw file
Possible License(s): MIT, CC-BY-SA-3.0
  1. using System;
  2. using Example;
  3. using FluentAssertions;
  4. using Machine.Specifications.Reporting.Generation;
  5. using Machine.Specifications.Runner;
  6. using Machine.Specifications.Runner.Impl;
  7. namespace Machine.Specifications.Reporting.Specs.Generation
  8. {
  9. [Subject(typeof(SpecificationTreeListener))]
  10. public class when_getting_a_tree_from_a_spec_run
  11. {
  12. static DefaultRunner runner;
  13. static SpecificationTreeListener listener;
  14. Establish context = () =>
  15. {
  16. listener = new SpecificationTreeListener();
  17. runner = new DefaultRunner(listener, RunOptions.Default);
  18. };
  19. Because of =
  20. () => runner.RunAssembly(typeof(when_a_customer_first_views_the_account_summary_page).Assembly);
  21. It should_set_the_total_specifications =
  22. () => listener.Run.TotalSpecifications.Should().Be(6);
  23. It should_set_the_report_generation_date =
  24. () => DateTime.Now.AddSeconds(-5).Should().BeOnOrBefore(listener.Run.Meta.GeneratedAt);
  25. It should_default_to_no_timestamp =
  26. () => listener.Run.Meta.ShouldGenerateTimeInfo.Should().BeFalse();
  27. It should_default_to_no_link_to_the_summary =
  28. () => listener.Run.Meta.ShouldGenerateIndexLink.Should().BeFalse();
  29. }
  30. }