예제 #1
0
 public void SetUp()
 {
     _lm = new LinkMaker(_bh);
     MockWikiApplication application = new MockWikiApplication(null, _lm, OutputFormat.HTML, 
         new MockTimeProvider(TimeSpan.FromSeconds(1))); 
     Federation = new Federation(application);
 }
예제 #2
0
 public void SetUp()
 {
     MockWikiApplication application = new MockWikiApplication(null,
         new LinkMaker("test://FileSystemStoreTests/"), OutputFormat.HTML,
         new MockTimeProvider(TimeSpan.FromSeconds(1)));
     _federation = new Federation(application);
 }
        public void SetUp()
        {
            _linkMaker = new LinkMaker(_baseUri);

            MockWikiApplication application = new MockWikiApplication(null,
                _linkMaker,
                OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1)));

            Federation = new Federation(application);
            Federation.WikiTalkVersion = 1;

            _provider.Initialize(Federation);
        }
예제 #4
0
        public void SetUp()
        {
            string author = "tester-joebob";
            _lm = new LinkMaker(_bh);
            MockWikiApplication application = new MockWikiApplication(null,
                _lm,
                OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1)));
            Federation = new Federation(application);

            _base = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Base");
            _other1 = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Other1");
            _other2 = WikiTestUtilities.CreateMockStore(Federation, "Other2");
            _other3 = WikiTestUtilities.CreateMockStore(Federation, "Other3");
            _namespaceManager5 = WikiTestUtilities.CreateMockStore(Federation, "Space5");

            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, _base.DefinitionTopicName.LocalName, @"Import: FlexWiki.Other1, Other2", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicOne", @"OtherOneHello", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicTwo", @"FlexWiki.Other1.OtherOneGoodbye", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicThree", @"No.Such.Namespace.FooBar", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicFour", @".TopicOne", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicFive", @"FooBar
Role:Designer", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicSix", @".GooBar
Role:Developer", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, _other1.DefinitionTopicName.LocalName, @"Import: Other3,Other2", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneHello", @"hello
Role:Developer", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneGoodbye", @"goodbye", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneRefThree", @"OtherThreeTest", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicOne", @"OtherTwoHello", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicTwo", @"Other2.OtherTwoGoodbye", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicThree", @"No.Such.Namespace.FooBar", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFour", @".OtherOneTopicOne", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFive", @"FooBar", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicSix", @".GooBar", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_other2, "OtherTwoHello", @"hello", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other2, "OtherTwoGoodbye", @"goodbye", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_other3, "OtherThreeTest", @"yo", author);



            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager5, "AbsRef", @"Other2.OtherTwoHello", author);

        }
예제 #5
0
        public void SetUp()
        {
            /* Set up a mock configuration with the following permissions: 
             * 
             * Wiki-wide: 
             * Alice: read, write, administer
             * Bob: read
             * 
             * NamespaceOne: 
             * Alice: read
             * 
             * NamespaceTwo
             * Bob: read, write, administer
             */
            MockWikiApplication application = new MockWikiApplication(
                null,
                null,
                OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1))); 

            _federation = new Federation(application);

            MockAuthorizationConfigurationProvider configProvider = new MockAuthorizationConfigurationProvider();
            configProvider.AddWikiPermission("Alice", Permission.Read);
            configProvider.AddWikiPermission("Alice", Permission.Edit);
            configProvider.AddWikiPermission("Alice", Permission.Administer);
            configProvider.AddWikiPermission("Bob", Permission.Read);
            configProvider.AddWikiPermission("WikiReaders", Permission.Read);
            configProvider.AddWikiPermission("WikiEditors", Permission.Edit);
            configProvider.AddWikiPermission("WikiAdmins", Permission.Administer);

            configProvider.AddNamespacePermission("Alice", "NamespaceOne", Permission.Read);

            configProvider.AddNamespacePermission("Bob", "NamespaceTwo", Permission.Read);
            configProvider.AddNamespacePermission("Bob", "NamespaceTwo", Permission.Edit);
            configProvider.AddNamespacePermission("Bob", "NamespaceTwo", Permission.Administer);

            configProvider.AddNamespacePermission("NS4Readers", "NamespaceFour", Permission.Read);
            configProvider.AddNamespacePermission("NS4Editors", "NamespaceFour", Permission.Edit);
            configProvider.AddNamespacePermission("NS4Admins", "NamespaceFour", Permission.Administer);

            configProvider.AddNamespacePermission("*", "NamespaceFive", Permission.Read);
            configProvider.AddNamespacePermission("?", "NamespaceFive", Permission.Edit);

            _federation.AuthorizationConfigurationProvider = configProvider;
        }
        public void Init()
        {
            MockWikiApplication application = new MockWikiApplication(null,
                new LinkMaker("http://boobar"), OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1)));
            Federation = new Federation(application);
            _base = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Projects.Wiki");
            _imp1 = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Projects.Wiki1");
            _imp2 = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Projects.Wiki2");

            string author = "tester-joebob";
            WikiTestUtilities.WriteTestTopicAndNewVersion(
                _base,
                _base.DefinitionTopicName.LocalName,
                @"
            Description: Test description
            Import: FlexWiki.Projects.Wiki1, FlexWiki.Projects.Wiki2", author);
        }
        public void SetUp()
        {
            FederationConfiguration configuration = new FederationConfiguration();
            // Grant everyone full control so we don't have security issues for the test.
            configuration.AuthorizationRules.Add(new WikiAuthorizationRule(
                new AuthorizationRule(new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAll), AuthorizationRulePolarity.Allow,
                    AuthorizationRuleScope.Wiki, SecurableAction.ManageNamespace, 0)));
            MockWikiApplication application = new MockWikiApplication(
                configuration,
                new LinkMaker("http://boobar"), OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1)));
            Federation = new Federation(application);
            _base = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Projects.Wiki");
            _imp1 = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Projects.Wiki1");
            _imp2 = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Projects.Wiki2");

            string author = "tester-joebob";
            WikiTestUtilities.WriteTestTopicAndNewVersion(
                _base,
                _base.DefinitionTopicName.LocalName,
            @"
            Description: Test description
            Import: FlexWiki.Projects.Wiki1",
                author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(
                _imp1,
                _imp1.DefinitionTopicName.LocalName,
            @"
            Description: Test1 description
            Import: FlexWiki.Projects.Wiki2",
                author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(
                _imp2,
                _imp2.DefinitionTopicName.LocalName,
            @"
            Description: Test1 description
            Import: FlexWiki.Projects.Wiki",
                author);
        }
예제 #8
0
        internal static Federation SetupFederation(string siteUrl, TestContentSet content, MockSetupOptions options, 
            FederationConfiguration federationConfiguration)
        {
            LinkMaker linkMaker = new LinkMaker(siteUrl);
            MockWikiApplication application = new MockWikiApplication(
                federationConfiguration, 
                linkMaker, 
                OutputFormat.HTML, 
                new MockTimeProvider(TimeSpan.FromSeconds(1)));
            Federation federation = new Federation(application);

            foreach (TestNamespace ns in content.Namespaces)
            {
                NamespaceManager storeManager = CreateMockStore(federation, ns.Name, options, ns.Parameters);

                foreach (TestTopic topic in ns.Topics)
                {
                    WriteTestTopicAndNewVersion(storeManager, topic.Name, topic.Content, topic.Author);
                }
            }

            return federation;

        }
예제 #9
0
        public void Init()
        {
            _lm = new LinkMaker(_base);
            MockWikiApplication application = new MockWikiApplication(
                null,
                _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, "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);

            _externals = new ExternalReferencesMap();
        }
예제 #10
0
        public void SetUp()
        {
            MockWikiApplication application = new MockWikiApplication(new FederationConfiguration(),
                new LinkMaker("test://FileSystemStoreTests/"), OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1)));
            federation = new Federation(application);
            _fileSystem = new MockFileSystem(
                new MockDirectory(@"C:\",
                    new MockDirectory("flexwiki",
                        new MockDirectory("namespaces",
                            new MockDirectory("namespaceone",
                                new MockFile(@"TopicOne.wiki", new DateTime(2004, 10, 28), @"This is some content"),
                                new MockFile(@"TopicTwo.wiki", new DateTime(2004, 10, 29), @"This is some other content"),
                                new MockFile(@"MULTIcapsGoodTopic.wiki",
                                    new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadOnly, true),

                                new MockFile(@"HomePage.wiki", new DateTime(2004, 10, 30), @"Home page."),
                                new MockFile(@"HomePage(2003-11-24-20-31-20-WINGROUP-davidorn).awiki",
                                    new DateTime(2004, 10, 31), @"Old home page."),

                                new MockFile(@"CodeImprovementIdeas.wiki", new DateTime(2004, 11, 10), @"Latest"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-03-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 09), @"Latest"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-04.8890-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 08), @"Older"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-05.1000-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 07), @"Still older"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-06.1-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 06), @"Even older"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-07-Name).awiki",
                                    new DateTime(2004, 11, 05), @"Really old"),
                                new MockFile(@"CodeImprovementIdeas(2003-11-23-14-34-08.123-Name).awiki",
                                    new DateTime(2004, 11, 04), @"Oldest"),

                                new MockFile(@"TestDeleteHistory.wiki", new DateTime(2004, 11, 10), @"Latest"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-03-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 09), @"Latest"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-04.8890-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 08), @"Older"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-05.1000-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 07), @"Still older"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-06.1-127.0.0.1).awiki",
                                    new DateTime(2004, 11, 06), @"Even older"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-07-Name).awiki",
                                    new DateTime(2004, 11, 05), @"Really old"),
                                new MockFile(@"TestDeleteHistory(2003-11-23-14-34-08.123-Name).awiki",
                                    new DateTime(2004, 11, 04), @"Oldest"),

                                new MockFile(@"ReadOnlyTopic.wiki",
                                    new DateTime(2004, 11, 05), @"", MockTopicStorePermissions.ReadOnly),
                                new MockFile(@"ReadOnlyTopic(2004-11-05-00-00-00-Name).awiki",
                                    new DateTime(2004, 11, 05), @""),
                                new MockFile(@"ReadOnlyTopic2.wiki",
                                    new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadOnly, true),
                                new MockFile(@"ReadWriteTopic.wiki",
                                    new DateTime(2004, 11, 05), new DateTime(2007, 10, 22), @"", MockTopicStorePermissions.ReadWrite, false),

                                new MockFile(@"DeletedTopic(2004-11-11-00-00-00-Name).awiki",
                                    new DateTime(2004, 11, 11), @"This topic was deleted.")
                             )
                         )
                     )
                 )
             );

            federation.RegisterNamespace(new FileSystemStore(_fileSystem), "NamespaceOne",
                new NamespaceProviderParameterCollection(
                    new NamespaceProviderParameter("Root", Root)));

            // Necessary to bypass security because a non-existent manager can't be
            // retrieved directly from the federation
            manager = WikiTestUtilities.GetNamespaceManagerBypassingSecurity(federation, "NamespaceOne");

            _provider = (FileSystemStore)manager.GetProvider(typeof(FileSystemStore));

            IMockWikiApplication setApp = (IMockWikiApplication)Federation.Application;
            setApp.SetApplicationProperty("DisableNewParser", false);
            setApp.SetApplicationProperty("EnableNewParser", true);
            parser = new ParserEngine(federation);
            //Necessary to init WikiInputDocument for all WomDocument tests
            //inputDoc = parser.InitWikiDocument(Path.Combine(mockapp.WebPath, @"InputDocs/AstralisLux.wiki"));
        }
예제 #11
0
        public void RegisterNamespace()
        {
            MockWikiApplication application = new MockWikiApplication(
                new FederationConfiguration(),
                new LinkMaker("test://federationtests"),
                OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1))); 

            Federation federation = new Federation(application);
            MockContentStore store = new MockContentStore();
            NamespaceManager storeManager = federation.RegisterNamespace(store, "MockStore");

            Assert.IsNotNull(storeManager, "Checking that a NamespaceManager was created.");
            Assert.AreSame(storeManager, store.NamespaceManager,
              "Checking that the MockContentStore is at the end of the content store chain.");
        }
예제 #12
0
        public void Init()
        {
            _lm = new LinkMaker(_base);
            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;

            string ns = "FlexWiki";
            string ns2 = "FlexWiki2";
            _namespaceManager = WikiTestUtilities.CreateMockStore(Federation, ns);
            _namespaceManager2 = WikiTestUtilities.CreateMockStore(Federation, ns2);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "HomePage", "", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, _namespaceManager.DefinitionTopicName.LocalName, @"Import: FlexWiki2", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "QualifiedLocalPropertyRef", @"
            Color: green
            color=@@topics.QualifiedLocalPropertyRef.Color@@", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "UnqualifiedLocalPropertyRef", @"
            Color: green
            color=@@Color@@", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "QualifiedLocalMethodRef", @"
            len=@@topics.QualifiedLocalMethodRef.DirectStringLength(""hello"")@@
            DirectStringLength: { str | str.Length }
            ", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "UnqualifiedLocalMethodRef", @"
            len=@@DirectStringLength(""hello"")@@
            DirectStringLength: { str | str.Length }
            ", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "LocalMethodIndirection", @"
            len=@@StringLength(""hello"")@@
            StringLength: { str | Len(str) }
            Len: { str | str.Length }
            ", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "LocalMethodIndirection2", @"
            len=@@StringLength(""hello"")@@
            StringLength: { str | Len(str) }
            Len: { s | s.Length }
            ", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "CallerBlockLocalsShouldBeInvisible", @"
            len=@@StringLength(""hello"")@@
            StringLength: { str | Len(str) }
            Len: { s | str.Length }
            ", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager2, "Profile", @"Color: puce", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "ReferAcrossNamespaces", @"@@topics.Profile.Color@@", _user);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TestChecker", @"
            Test: { FearFactor }
            Color: green", _user);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "CallTestChecker", @"
            FearFactor: nighttime
            test=@@topics.TestChecker.Test@@
            ", _user);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "Topic1", @"
            Function: { arg1 | topics.Topic2.FunctionTwo( { arg1 } ) }
            ", _user);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "Topic2", @"
            FunctionTwo: { someArg | 	someArg.Value }
            ", _user);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "Topic3", @"@@topics.Topic1.Function(100)@@", _user);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BlockCanSeeLexicalScopeCaller", @"
            result=@@ topics.BlockCanSeeLexicalScopeCallee.BlockValue( { Color } ) @@
            Color: green", _user);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BlockCanSeeLexicalScopeCallee", @"
            BlockValue: {aBlock | aBlock.Value }", _user);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "ThisTests", @"
            topicName=@@topicName.Name@@
            namespace=@@namespace.Name@@
            nscount=@@federation.Namespaces.Count@@
            color=@@this.Color@@
            Color: red
            ", _user);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "WikiTalkHomeObject", @"
            @@topics@@
            namespace=@@namespace@@
            federation=@@federation@@
            color=@@this.Color@@
            Color: red
            true = @@true@@
            empty = @@empty@@(this is empty)
            false = @@false@@
            null = @@null@@
            ", _user);
        }
예제 #13
0
        public void SetUp()
        {
            string author = "tester-joebob";
            _lm = new LinkMaker(_bh);

            // Allow everyone all permissions
            FederationConfiguration configuration = new FederationConfiguration();
            configuration.AuthorizationRules.Add(new WikiAuthorizationRule(
                new AuthorizationRule(new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAll, null), AuthorizationRulePolarity.Allow,
                AuthorizationRuleScope.Wiki, SecurableAction.ManageNamespace, 0)));
            MockWikiApplication application = new MockWikiApplication(
                configuration,
                _lm,
                OutputFormat.HTML,
                new MockTimeProvider(TimeSpan.FromSeconds(1)));
            Federation = new Federation(application);

            _base = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Base");
            _other1 = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Other1");
            _other2 = WikiTestUtilities.CreateMockStore(Federation, "Other2");
            _other3 = WikiTestUtilities.CreateMockStore(Federation, "Other3");
            _namespaceManager5 = WikiTestUtilities.CreateMockStore(Federation, "Space5");

            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, _base.DefinitionTopicName.LocalName, @"Import: FlexWiki.Other1, Other2", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicOne", @"OtherOneHello", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicTwo", @"FlexWiki.Other1.OtherOneGoodbye", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicThree", @"No.Such.Namespace.FooBar", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicFour", @".TopicOne", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicFive", @"FooBar
            Role:Designer", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicSix", @".GooBar
            Role:Developer", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, _other1.DefinitionTopicName.LocalName, @"Import: Other3,Other2", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneHello", @"hello
            Role:Developer", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneGoodbye", @"goodbye", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneRefThree", @"OtherThreeTest", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicOne", @"OtherTwoHello", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicTwo", @"Other2.OtherTwoGoodbye", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicThree", @"No.Such.Namespace.FooBar", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFour", @".OtherOneTopicOne", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFive", @"FooBar", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicSix", @".GooBar", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_other2, "OtherTwoHello", @"hello", author);
            WikiTestUtilities.WriteTestTopicAndNewVersion(_other2, "OtherTwoGoodbye", @"goodbye", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_other3, "OtherThreeTest", @"yo", author);

            WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager5, "AbsRef", @"Other2.OtherTwoHello", author);
        }
        public void SetUp()
        {
            string author = "tester-joebob";
            _lm = new LinkMaker("http://bogusville");
            MockWikiApplication application = new MockWikiApplication(
                null,
                _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);
            System.Threading.Thread.Sleep(100); // need the newer one to be newer enough!
            WikiTestUtilities.WriteTestTopicAndNewVersion(_storeManager, "TopicOne", @"1
            2
            a
            b
            c
            3
            4
            5
            6
            7
            8
            9", author);
            System.Threading.Thread.Sleep(100); // need the newer one to be newer enough!
            WikiTestUtilities.WriteTestTopicAndNewVersion(_storeManager, "TopicOne", @"1
            2
            a
            b
            6
            7
            8
            9", author);

            foreach (TopicChange change in _storeManager.AllChangesForTopic("TopicOne"))
                _versions.Add(change.Version);
        }