/source/test/NOS.TabMenu.Tests/TabMenuSpecs.cs

http://github.com/agross/netopenspace · C# · 52 lines · 41 code · 11 blank · 0 comment · 0 complexity · cf3105c7543874a6042b3dad7e7b94d6 MD5 · raw file

  1. using Machine.Specifications;
  2. using Rhino.Mocks;
  3. using ScrewTurn.Wiki.PluginFramework;
  4. namespace NOS.TabMenu.Tests
  5. {
  6. [Subject(typeof(TabMenu))]
  7. public class When_the_tab_menu_is_active
  8. {
  9. static TabMenu TabMenu;
  10. Because of = () => { TabMenu = new TabMenu(); };
  11. It should_render_on_each_request_regardless_of_the_cache =
  12. () => TabMenu.PerformPhase3.ShouldBeTrue();
  13. }
  14. [Subject(typeof(TabMenu))]
  15. public class When_the_tab_menu_is_formatted_for_a_non_content_page
  16. {
  17. static TabMenu TabMenu;
  18. Establish context = () =>
  19. {
  20. Host = MockRepository.GenerateStub<IHostV30>();
  21. Host
  22. .Stub(x => x.GetSettingValue(SettingName.RootNamespaceDefaultPage))
  23. .Return("the default page");
  24. TabMenu = new TabMenu();
  25. TabMenu.Init(Host, null);
  26. };
  27. Because of = () => TabMenu.Format("raw",
  28. new ContextInformation(false,
  29. false,
  30. FormattingContext.PageContent,
  31. null,
  32. "en-US",
  33. null,
  34. null,
  35. new string[] { }),
  36. FormattingPhase.Phase3);
  37. It should_render_on_each_request_regardless_of_the_cache =
  38. () => TabMenu.PerformPhase3.ShouldBeTrue();
  39. static IHostV30 Host;
  40. }
  41. }