PageRenderTime 78ms CodeModel.GetById 72ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

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