PageRenderTime 51ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/Source/Reporting/Machine.Specifications.Reporting.Specs/Visitors/IgnoredSpecificationLinkerSpecs.cs

https://github.com/machine/machine.specifications
C# | 71 lines | 57 code | 14 blank | 0 comment | 0 complexity | 6e52e30790df76e6e1fe1ad231650caa MD5 | raw file
Possible License(s): MIT, CC-BY-SA-3.0
  1. using FluentAssertions;
  2. using Machine.Specifications.Reporting.Model;
  3. using Machine.Specifications.Reporting.Visitors;
  4. namespace Machine.Specifications.Reporting.Specs.Visitors
  5. {
  6. [Subject(typeof(IgnoredSpecificationLinker))]
  7. public class when_ignored_specifications_are_linked : ReportSpecs
  8. {
  9. static IgnoredSpecificationLinker Linker;
  10. static Run Report;
  11. static Specification Specification;
  12. static Specification First;
  13. static Specification Second;
  14. static Specification Last;
  15. Establish context = () =>
  16. {
  17. Linker = new IgnoredSpecificationLinker();
  18. First = Spec("it", "a 1 c 1 c 1 specification 1", Result.Ignored());
  19. Second = Spec("it", "a 2 c 1 c 1 specification 1", Result.Ignored());
  20. Last = Spec("it", "a 2 c 1 c 2 specification 1", Result.Ignored());
  21. Report = Run(Assembly("assembly 1",
  22. Concern("a 1 concern 1",
  23. Context("a 1 c 1 context 1",
  24. First,
  25. Spec("it", "a 1 c 1 c 1 specification 2", Result.Pass())
  26. )
  27. )
  28. ),
  29. Assembly("assembly 2",
  30. Concern("a 2 concern 1",
  31. Context("a 2 c 1 context 1",
  32. Spec("it", "a 2 c 1 c 1 specification 2", Result.Pass()),
  33. Second),
  34. Context("a 2 c 1 context 2",
  35. Last,
  36. Spec("it", "a 2 c 1 c 2 specification 2", Result.Pass()))))
  37. );
  38. };
  39. Because of = () => Linker.Visit(Report);
  40. It should_not_assign_a__previous__link_to_the_report =
  41. () => Report.PreviousIgnored.Should().BeNull();
  42. It should_assign_a__next__link_to_the_report =
  43. () => Report.NextIgnored.Should().Be(First);
  44. It should_assign_a__next__link_to_the_first_ignored_spec =
  45. () => First.NextIgnored.Should().Be(Second);
  46. It should_not_assign_a__previous__link_to_the_first_ignored_spec =
  47. () => First.PreviousIgnored.Should().BeNull();
  48. It should_assign_a__next__link_to_the_second_ignored_spec =
  49. () => Second.NextIgnored.Should().Be(Last);
  50. It should_assign_a__previous__link_to_the_second_ignored_spec =
  51. () => Second.PreviousIgnored.Should().Be(First);
  52. It should_not_assign_a__next__link_to_the_last_ignored_spec =
  53. () => Last.NextIgnored.Should().BeNull();
  54. It should_assign_a__previous__link_to_the_last_ignored_spec =
  55. () => Last.PreviousIgnored.Should().Be(Second);
  56. }
  57. }