• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Tests.FullInputContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Tests.FullInputContext的典型用法代码示例。如果您正苦于以下问题:C# FullInputContext类的具体用法?C# FullInputContext怎么用?C# FullInputContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FullInputContext类属于Tests命名空间,在下文中一共展示了FullInputContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetupTestSite

 public void SetupTestSite()
 {
     _inputcontext = new FullInputContext("");
     _testSite = new Site(1, "h2g2", 0, false, "brunel", true, "H2G2", "h2g2",
                 "[email protected]", "[email protected]", "[email protected]", 1090497224, false, true, true, "", "Alert", 2000, 1090497224, 0,
                 1, 1, false, false, 16, 255, 1, "h2g2", false, "brunel", "", "");
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:7,代码来源:SiteTests.cs


示例2: TestAbsentSkinParams

		public void TestAbsentSkinParams()
		{
            Console.WriteLine("TestAbsentSkinParams");
            using (FullInputContext inputcontext = new FullInputContext(""))
            {
                inputcontext.SetCurrentSite("h2g2");
                inputcontext.InitDefaultUser();

                inputcontext.AddParam("notaskinparam", "abcde");
                inputcontext.AddParam("ss_not", "doesn't matter");

                SkinParams sparams = new SkinParams(inputcontext);
                sparams.ProcessRequest();
                DnaXmlValidator validator = new DnaXmlValidator(sparams.RootElement.InnerXml, _schemaUri);
                validator.Validate();

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(sparams.RootElement.OuterXml);

                XmlNode node = doc.SelectSingleNode("/DNAROOT/PARAMS");
                Assert.IsNotNull(node, "No PARAMS element found");
                XmlNodeList nodes = doc.SelectNodes("/DNAROOT/PARAMS/PARAM");

                Assert.IsNotNull(nodes, "Unable to find /DNAROOT/PARAMS/PARAM");

                Assert.IsTrue(nodes.Count == 0, string.Format("Expecting 0 s_ params in query, found {0}", nodes.Count));
            }
		}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:28,代码来源:SkinParamsTests.cs


示例3: StartUp

        public void StartUp()
        {
            SnapshotInitialisation.RestoreFromSnapshot();
            FullInputContext context = new FullInputContext("");

            _siteList = context.SiteList;
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:7,代码来源:commentforums_v1.cs


示例4: Initialise

 public void Initialise()
 {
     using(var context = new FullInputContext(""))
     {
         var ug = new BBC.Dna.Users.UserGroups(context.ReaderCreator, context.Diagnostics, CacheFactory.GetCacheManager(), null, null);
     }
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:7,代码来源:ModeratorManagementTests.cs


示例5: Setup

        public void Setup()
        {
            using (FullInputContext inputcontext = new FullInputContext(""))
            {
                _appContext = new AppContext(TestConfig.GetConfig().GetRipleyServerPath());
                _siteOptionList = new SiteOptionList();
                _siteOptionList.CreateFromDatabase(inputcontext.ReaderCreator, inputcontext.dnaDiagnostics);
            }
            
            DnaTestURLRequest request = new DnaTestURLRequest("haveyoursay");
            request.SetCurrentUserNormal();
            IInputContext inputContext = DnaMockery.CreateDatabaseInputContext();
            using (IDnaDataReader dataReader = inputContext.CreateDnaDataReader(""))
            {
                SetSiteID(dataReader, "h2g2");

                _includeContentFromOtherSites = _siteOptionList.GetValueBool(_siteId, "PersonalSpace", "IncludeContentFromOtherSites");

                //Create a post on h2g2
                SetForumID(dataReader);
                request = new DnaTestURLRequest("h2g2");
                request.SetCurrentUserNormal();
                int id = request.CurrentUserID;
                request.RequestPage("AddThread?subject=test&body=blahblah&post=1&skin=purexml&forum=" + Convert.ToString(_forumId));

                //Create a post on have your say.
                SetSiteID(dataReader, "haveyoursay");
                SetForumID(dataReader);
                request = new DnaTestURLRequest("haveyoursay");
                request.SetCurrentUserNormal();
                request.RequestPage("AddThread?subject=test&body=blahblah&post=1&skin=purexml&forum=" + Convert.ToString(_forumId));
            }
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:33,代码来源:UserPageTests.cs


示例6: Test01CreateAUserFromDNAUserID

 public void Test01CreateAUserFromDNAUserID()
 {
     FullInputContext context = new FullInputContext(true);
     User user = new User(null, null, null);
     Assert.IsTrue(user.CreateUserFromDnaUserID(TestUserAccounts.GetModeratorAccount.UserID, 1));
     Assert.IsTrue(user.IsUserA(UserTypes.Moderator));
     Assert.IsFalse(user.IsUserA(UserTypes.Editor));
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:8,代码来源:BBC.Dna.UserTests.cs


示例7: Test2LoadSiteListTest

 public void Test2LoadSiteListTest()
 {
     Console.WriteLine("Test2LoadSiteListTest");
     using (FullInputContext inputcontext = new FullInputContext(""))
     {
         SiteList testSiteList = new SiteList(inputcontext.ReaderCreator, inputcontext.dnaDiagnostics, CacheFactory.GetCacheManager(),null, null);
         _siteListloaded = true;
     }
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:9,代码来源:SiteListTests.cs


示例8: Test3GetSiteh2g2byidTest

 public void Test3GetSiteh2g2byidTest()
 {
     Console.WriteLine("Test3GetSiteh2g2byidTest");
     using (FullInputContext inputcontext = new FullInputContext(""))
     {
         Site h2g2 = (Site)_testSiteList.GetSite(1);
         Assert.AreEqual(h2g2.SiteName, "h2g2");
     }
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:9,代码来源:SiteListTests.cs


示例9: UserTests

  /// <summary>
  /// Constructor for the User Tests to set up the context for the tests
  /// </summary>
  public UserTests()
  {
      using (FullInputContext fullinputcontext = new FullInputContext(TestUserAccounts.GetProfileAPITestUserAccount.UserName))
      {
          fullinputcontext.SetCurrentSite("h2g2");
          fullinputcontext.InitUserFromCookie(TestUserAccounts.GetProfileAPITestUserAccount.Cookie, TestUserAccounts.GetProfileAPITestUserAccount.SecureCookie);
          _testUser = (User)fullinputcontext.ViewingUser;
      }
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:UserTests.cs


示例10: CommentCreateTests

 /// <summary>
 /// Constructor
 /// </summary>
 public CommentCreateTests()
 {
     using (FullInputContext inputcontext = new FullInputContext(""))
     {
         _siteList = SiteList.GetSiteList();
         site = _siteList.GetSite("h2g2");
         _comments = new Comments(inputcontext.dnaDiagnostics, inputcontext.ReaderCreator, CacheFactory.GetCacheManager(), _siteList);
     }
     
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:13,代码来源:CommentCreate.cs


示例11: StartUp

 public void StartUp()
 {
     SnapshotInitialisation.RestoreFromSnapshot();
     DnaTestURLRequest testUserReq = new DnaTestURLRequest(testUtils_CommentsAPI.sitename);
     testUserReq.SetCurrentUserNormal();
     clearFromDB(testUserReq);
     using (FullInputContext inputContext = new FullInputContext(""))
     {
         inputContext.SendSignal("action=recache-groups");
     }
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:11,代码来源:groupSignalTests.cs


示例12: Test02SignUserInViaIdentityCookie

 public void Test02SignUserInViaIdentityCookie()
 {
     FullInputContext context = new FullInputContext(true);
     SignInSystem signInType = SignInSystem.Identity;
     CallingUser user = new CallingUser(signInType, null, null, null, context.SiteList);
     string cookie = TestUserAccounts.GetModeratorAccount.Cookie;
     string policy = "http://identity/policies/dna/adult";
     int siteID = 1;
     Assert.IsTrue(user.IsUserSignedIn(cookie, policy, siteID, ""));
     Assert.IsTrue(user.IsUserA(UserTypes.Moderator));
     Assert.IsFalse(user.IsUserA(UserTypes.Editor));
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:BBC.Dna.UserTests.cs


示例13: TestValidUserIsLoggedIn

 private void TestValidUserIsLoggedIn()
 {
     Console.WriteLine("TestValidUserIsLoggedIn");
     // Create the profile connection first
     using (FullInputContext inputContext = new FullInputContext(false))
     {
         IDnaIdentityWebServiceProxy testProfile = inputContext.GetCurrentSignInObject;
         testProfile.SetService("h2g2");
         testProfile.TrySetUserViaCookie("44c5a3037b5a65b37bbef0f591cdf10e1d9e59903823a0cb01270e7da41e8e3b00");
         Assert.IsTrue(testProfile.IsUserLoggedIn, "User should be logged in.");
     }
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:ProfileAPITests.cs


示例14: StartUp

 public void StartUp()
 {
     Console.WriteLine("Signal Test StartUp");
     // First get the open close times for the h2g2 site
     SnapshotInitialisation.RestoreFromSnapshot();
     SetSiteEmergencyClosed(false);
     using (FullInputContext inputContext = new FullInputContext(false))
     {
         inputContext.SendSignal("action=recache-site");
     }
     
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:SignalTests.cs


示例15: Test02SignUserInViaIdentityCookie

 public void Test02SignUserInViaIdentityCookie()
 {
     FullInputContext context = new FullInputContext("");
     SignInSystem signInType = SignInSystem.Identity;
     CallingUser user = new CallingUser(signInType, null, null, null, TestUserAccounts.GetModeratorAccount.UserName, context.SiteList);
     string cookie = TestUserAccounts.GetModeratorAccount.Cookie;
     string policy = "comment";
     int siteID = 1;
     Assert.IsTrue(user.IsUserSignedIn(cookie, policy, siteID, "", null, Guid.Empty));
     Assert.IsTrue(user.IsUserA(UserTypes.Moderator));
     Assert.IsFalse(user.IsUserA(UserTypes.Editor));
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:BBC.Dna.UserTests.cs


示例16: TestsSetup

        public void TestsSetup()
        {
            //SnapshotInitialisation.ForceRestore();
            using (FullInputContext _context = new FullInputContext(""))
            {
                dnaDiagnostics = _context.dnaDiagnostics;
                readerCreator = new DnaDataReaderCreator(_context.DnaConfig.ConnectionString, dnaDiagnostics);
            }
            var bannedEmails = new BannedEmails(readerCreator, dnaDiagnostics, _emailCache, null, null);

            bannedEmails.Clear();
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:BBC.Dna.BannedEmailsTests.cs


示例17: Setup

        public void Setup()
        {
            SnapshotInitialisation.RestoreFromSnapshot();

            using (FullInputContext _context = new FullInputContext(""))
            {

                using (IDnaDataReader dataReader = _context.CreateDnaDataReader(""))
                {
                    dataReader.ExecuteDEBUGONLY("update threadentries set hidden=null where entryid=" + _postId.ToString());
                }
            }
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:13,代码来源:EditPostsPageTests.cs


示例18: InitialiseSiteList

 private static void InitialiseSiteList()
 {
     if (!_siteListloaded)
     {
         using (FullInputContext inputcontext = new FullInputContext(""))
         {
             _testSiteList = SiteList.GetSiteList();
             inputcontext.SetCurrentSite("h2g2");
             inputcontext.InitDefaultUser();
             _siteListloaded = true;
         }
     }
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:13,代码来源:SiteListTests.cs


示例19: RatingForumTests

        /// <summary>
        /// Constructor
        /// </summary>
        public RatingForumTests()
        {
            using (FullInputContext inputcontext = new FullInputContext(""))
            {
                _siteList = SiteList.GetSiteList();
                site = _siteList.GetSite("h2g2");

                _ratings = new Reviews(inputcontext.dnaDiagnostics, inputcontext.ReaderCreator, CacheFactory.GetCacheManager(), _siteList);
                var b = new BannedEmails(inputcontext.ReaderCreator, inputcontext.dnaDiagnostics, CacheFactory.GetCacheManager(), null, null);
                var g = new UserGroups(inputcontext.ReaderCreator, inputcontext.dnaDiagnostics, CacheFactory.GetCacheManager(), null, null);
            }
            
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:16,代码来源:RatingForum.cs


示例20: Test03SignUserInAndAddThemToAcesGroup

 public void Test03SignUserInAndAddThemToAcesGroup()
 {
     FullInputContext context = new FullInputContext(true);
     SignInSystem signInType = SignInSystem.Identity;
     CallingUser user = new CallingUser(signInType, context.ReaderCreator, null, null, context.SiteList);
     string cookie = TestUserAccounts.GetModeratorAccount.Cookie;
     string policy = "http://identity/policies/dna/adult";
     int siteID = 1;
     Assert.IsTrue(user.IsUserSignedIn(cookie, policy, siteID, ""));
     Assert.IsTrue(user.IsUserA(UserTypes.Moderator));
     Assert.IsFalse(user.GetUsersGroupsForSite().Exists(x => x.Name == "aces"));
     Assert.IsTrue(user.AddUserToGroup("Aces"));
     Assert.IsTrue(user.GetUsersGroupsForSite().Exists(x => x.Name == "aces"));
 }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:14,代码来源:BBC.Dna.UserTests.cs



注:本文中的Tests.FullInputContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tests.Options类代码示例发布时间:2022-05-26
下一篇:
C# Tests.DnaXmlValidator类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap