public void SetUp() { MockWikiApplication application = new MockWikiApplication(new FederationConfiguration(), new LinkMaker("test://SqlStoreTests/"), OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); _federation = new Federation(application); _database = new MockDatabase(TestDataSets.Default()); _federation.RegisterNamespace(new SqlStore(_database), "NamespaceOne", new NamespaceProviderParameterCollection( new NamespaceProviderParameter("ConnectionString", _connectionString))); // Necessary to bypass security because a non-existent manager can't be // retrieved directly from the federation NamespaceManager manager = WikiTestUtilities.GetNamespaceManagerBypassingSecurity(_federation, "NamespaceOne"); _provider = (SqlStore)manager.GetProvider(typeof(SqlStore)); }
public void SetUp() { _lm = new LinkMaker(c_siteUrl); FederationConfiguration configuration = new FederationConfiguration(); AuthorizationRule rule = new AuthorizationRule(new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAll, null), AuthorizationRulePolarity.Allow, AuthorizationRuleScope.Wiki, SecurableAction.ManageNamespace, 0); configuration.AuthorizationRules.Add(new WikiAuthorizationRule(rule)); MockWikiApplication application = new MockWikiApplication( configuration, _lm, OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); Federation = new Federation(application); Federation.WikiTalkVersion = 1; _namespaceManager = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki"); //_namespaceManager.Title = "Friendly Title"; WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "_ContentBaseDefinition", "Title: Friendly Title", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "HomePage", "Home is where the heart is", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BigPolicy", "This is ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BigDog", "This is ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BigAddress", "This is ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BigBox", "This is ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeOne", "inc1", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeTwo", "!inc2", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeThree", "!!inc3", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeFour", "!inc4", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeNest", @" {{IncludeNest1}} {{IncludeNest2}}", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TopicWithColor", "Color: Yellow", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeNest1", "!hey there", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeNest2", "!black dog", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeNestURI", @"wiki://IncludeNest1 wiki://IncludeNest2 ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "ResourceReference", @"URI: http://www.google.com/$$$", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "FlexWiki", "flex ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "InlineTestTopic", @"aaa @@""foo""@@ zzz", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "OneMinuteWiki", "one ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TestIncludesBehaviors", "@@ProductName@@ somthing @@Now@@ then @@Now@@", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "_Underscore", "Underscore", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TopicWithBehaviorProperties", @" Face: {""hello"".Length} one FaceWithArg: {arg | arg.Length } FaceSpanningLines:{ arg | arg.Length } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TestTopicWithBehaviorProperties", @" len=@@topics.TopicWithBehaviorProperties.Face@@ lenWith=@@topics.TopicWithBehaviorProperties.FaceWithArg(""superb"")@@ lenSpanning=@@topics.TopicWithBehaviorProperties.FaceSpanningLines(""parsing is wonderful"")@@ ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TestTopicWithBehaviorProperty", @"lenSpanning=@@topics.TopicWithBehaviorProperties.FaceSpanningLines(""parsing is wonderful"")@@", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TopicWithInclude", "{{TopicOneNoRead}}", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TopicOneNoRead", @"DenyRead: all PropertyOne: ValueOne PropertyTwo: Value Two PropertyOne: List, of, values", _user); _externals = new ExternalReferencesMap(); }
public void SetUp() { string author = "tester-joebob"; _lm = new LinkMaker("http://bogusville"); FederationConfiguration configuration = new FederationConfiguration(); AuthorizationRule rule = new AuthorizationRule(new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAll, null), AuthorizationRulePolarity.Allow, AuthorizationRuleScope.Wiki, SecurableAction.ManageNamespace, 0); configuration.AuthorizationRules.Add(new WikiAuthorizationRule(rule)); MockWikiApplication application = new MockWikiApplication( configuration, _lm, OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); Federation = new Federation(application); _versions = new ArrayList(); _storeManager = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Base"); WikiTestUtilities.WriteTestTopicAndNewVersion(_storeManager, "TopicOne", @"1 2 3 4 5 6 7 8 9", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_storeManager, "TopicOne", @"1 2 a b c 3 4 5 6 7 8 9", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_storeManager, "TopicOne", @"1 2 a b 6 7 8 9", author); foreach (TopicChange change in _storeManager.AllChangesForTopic("TopicOne")) { _versions.Add(change.Version); } }