當前位置: 首頁>>代碼示例>>C#>>正文


C# Tests.FullInputContext類代碼示例

本文整理匯總了C#中Tests.FullInputContext的典型用法代碼示例。如果您正苦於以下問題:C# FullInputContext類的具體用法?C# FullInputContext怎麽用?C# FullInputContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FullInputContext類屬於Tests命名空間,在下文中一共展示了FullInputContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Tests.FullInputContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。