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

/Source/Examples/Example.Random/ContainedContextSpecs.cs

https://github.com/machine/machine.specifications
C# | 50 lines | 41 code | 9 blank | 0 comment | 0 complexity | ad0add74ee865d2957bfb7fc7a11957d MD5 | raw file
Possible License(s): MIT, CC-BY-SA-3.0
  1. using FluentAssertions;
  2. using Machine.Specifications;
  3. namespace Example.Random
  4. {
  5. public static class StaticContainer
  6. {
  7. static readonly bool Foo;
  8. static StaticContainer()
  9. {
  10. Foo = true;
  11. }
  12. public class when_a_context_is_nested_inside_a_static_class
  13. {
  14. It should_be_run = () => Foo.Should().BeTrue();
  15. }
  16. }
  17. public class NonStaticContainer
  18. {
  19. static readonly bool Bar;
  20. static NonStaticContainer()
  21. {
  22. Bar = true;
  23. }
  24. public static class StaticContainer
  25. {
  26. static readonly bool Foo;
  27. static StaticContainer()
  28. {
  29. Foo = true;
  30. }
  31. public class when_a_context_is_nested_inside_a_static_class_that_is_nested_inside_a_class
  32. {
  33. It should_be_run = () =>
  34. {
  35. Foo.Should().BeTrue();
  36. Bar.Should().BeTrue();
  37. };
  38. }
  39. }
  40. }
  41. }