本文整理汇总了C#中Tests.DnaXmlValidator类的典型用法代码示例。如果您正苦于以下问题:C# DnaXmlValidator类的具体用法?C# DnaXmlValidator怎么用?C# DnaXmlValidator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DnaXmlValidator类属于Tests命名空间,在下文中一共展示了DnaXmlValidator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Test1CreateForumWithNoCloseDate
public void Test1CreateForumWithNoCloseDate()
{
Console.WriteLine("Before CommentForumClosingDateTests - Test1CreateForumWithNoCloseDate");
// Create a new comment box with no closing date
DnaTestURLRequest request = new DnaTestURLRequest("haveyoursay");
request.SetCurrentUserNormal();
// Setup the request url
string uid = Guid.NewGuid().ToString();
string title = "Testing";
string hosturl = "http://local.bbc.co.uk/dna/haveyoursay/acs";
string url = "acs?dnauid=" + uid + "&dnainitialtitle=" + title + "&dnahostpageurl=" + hosturl + "&dnaforumduration=0&skin=purexml";
// now get the response
request.RequestPage(url);
// Check to make sure that the page returned with the correct information
XmlDocument xml = request.GetLastResponseAsXML();
DnaXmlValidator validator = new DnaXmlValidator(xml.OuterXml, _schemaUri);
validator.Validate();
Assert.IsTrue(xml.SelectSingleNode("/H2G2/COMMENTBOX") != null,"Comment box tag doers not exist!");
//Assert.IsTrue(xml.SelectSingleNode("/H2G2/COMMENTBOX/ENDDATE") != null,"End date missing when specified!");
Assert.IsTrue(xml.SelectSingleNode("/H2G2/COMMENTBOX/FORUMTHREADPOSTS[@UID='" + uid + "']") != null, "Forums uid does not matched the one used to create!");
Assert.IsTrue(xml.SelectSingleNode("/H2G2/COMMENTBOX/FORUMTHREADPOSTS[@HOSTPAGEURL='" + hosturl + "']") != null, "Host url does not match the one used to create!");
Assert.IsTrue(xml.SelectSingleNode("/H2G2/COMMENTBOX/FORUMTHREADPOSTS[@CANWRITE='1']") != null, "The forums can write flag should be set 1");
Console.WriteLine("After CommentForumClosingDateTests - Test1CreateForumWithNoCloseDate");
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:29,代码来源:CommentForumClosingDateTests.cs
示例2: repeatCreateForum
public void repeatCreateForum()
{
Console.WriteLine("Before uniqueId - repeatCreateForum");
// test variant data
string sharedId = "";
string sharedIdRemembered = "";
// these will come out of the call to createForum so that they can be used in the checking
string title1 = "";
string title2 = "test2";
string parentUri1 = "";
string parentUri2 = "url2";
// working data
int newSiteCount = 0;
DnaTestURLRequest theRequest = null;
XmlDocument xmlOut = null;
DnaXmlValidator validator = null;
BBC.Dna.Api.CommentForum returnedForum = null;
// first time around, expect to be able to create the forum
testUtils_CommentsAPI.runningForumCount = testUtils_CommentsAPI.countForums(testUtils_CommentsAPI.sitename);
theRequest = createForum(ref sharedId, ref title1, ref parentUri1);
newSiteCount = testUtils_CommentsAPI.countForums(testUtils_CommentsAPI.sitename); // there should be 1 more forum
Assert.IsTrue(newSiteCount == (testUtils_CommentsAPI.runningForumCount + 1));
sharedIdRemembered = sharedId; // remember it because the next call to createForum may change it.
testUtils_CommentsAPI.runningForumCount = newSiteCount;
// second time around,
// expect this to fail because the ID is the same
parentUri2 = parentUri1 + "2";
theRequest = createForum(ref sharedId, ref title2, ref parentUri2);
/*
* this repeatedly times-out
newSiteCount = testUtils_CommentsAPI.countForums(testUtils_CommentsAPI.sitename); // there should be 1 more forum
Assert.IsTrue(newSiteCount == testUtils_CommentsAPI.runningForumCount);
*/
// the response matches the schema
xmlOut = theRequest.GetLastResponseAsXML(); // 1d. check the result of the creation process is good
validator = new DnaXmlValidator(xmlOut.InnerXml, testUtils_CommentsAPI._schemaCommentForum);
validator.Validate();
// the returned forum should be the one that was initially created
returnedForum = (BBC.Dna.Api.CommentForum)StringUtils.DeserializeObject(theRequest.GetLastResponseAsString(), typeof(BBC.Dna.Api.CommentForum));
Assert.IsTrue(returnedForum.Id == sharedIdRemembered, "The new forum's ID has chagned from " +sharedIdRemembered+" to " +returnedForum.Id);
Assert.IsTrue(returnedForum.Title == title2, "The new forum's Title has cahgned from " +title1+ " to " +returnedForum.Title);
Assert.IsTrue(returnedForum.ParentUri == parentUri2, "The new forum's ParentURI has changed from " +parentUri1+ " to " +returnedForum.ParentUri);
Assert.IsTrue(returnedForum.commentList.TotalCount == 0, "The new forum's should have an empty commentList, it is not empty");
Console.WriteLine("After uniqueId - repeatCreateForum");
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:60,代码来源:UinqueUIDTest_v1.cs
示例3: countForums
public static int runningForumCount = 0; // used to see our starting count, before we start adding forums.
/// <summary>
/// Simply count the number of commentsForums that have been created so far on this site
/// </summary>
/// <param name="SiteName">the name of the sute to query</param>
/// <returns>teh count</returns>
public static int countForums(string SiteName)
{
string _server = DnaTestURLRequest.CurrentServer;
DnaTestURLRequest request = new DnaTestURLRequest(SiteName);
request.SetCurrentUserNormal();
// Setup the request url
string url = "http://" + _server + "/dna/api/comments/CommentsService.svc/v1/site/" + SiteName + "/";
// now get the response - no POST data, nor any clue about the input mime-type
request.RequestPageWithFullURL(url, "", "");
Assert.IsTrue(request.CurrentWebResponse.StatusCode == HttpStatusCode.OK);
XmlDocument xml = request.GetLastResponseAsXML();
DnaXmlValidator validator = new DnaXmlValidator(xml.InnerXml, _schemaCommentForumList);
validator.Validate();
BBC.Dna.Api.CommentForumList returnedList = (BBC.Dna.Api.CommentForumList)StringUtils.DeserializeObject(request.GetLastResponseAsString(), typeof(BBC.Dna.Api.CommentForumList));
Assert.IsTrue(returnedList != null);
return returnedList.TotalCount;
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:32,代码来源:TestUtils_commentsAPI.cs
示例4: DuplicatePostParams
public void DuplicatePostParams()
{
Console.WriteLine("DuplicatePostParams");
DnaTestURLRequest request = new DnaTestURLRequest("haveyoursay");
Queue<KeyValuePair<string, string>> postparams = new Queue<KeyValuePair<string, string> >();
postparams.Enqueue(new KeyValuePair<string,string>("s_param", "1,1"));
postparams.Enqueue(new KeyValuePair<string,string>("s_param", "2,2"));
postparams.Enqueue(new KeyValuePair<string,string>("s_param", "3,3"));
request.RequestPage("acs?skin=purexml", postparams);
string paramvalue = "1,1,2,2,3,3";
XmlDocument doc = request.GetLastResponseAsXML();
DnaXmlValidator validator = new DnaXmlValidator(doc.InnerXml, "H2G2CommentBoxFlat.xsd");
validator.Validate();
validator = new DnaXmlValidator(doc.SelectSingleNode(@"H2G2/PARAMS").OuterXml, "Params.xsd");
validator.Validate();
XmlNodeList nodes = doc.SelectNodes(@"H2G2/PARAMS/PARAM");
foreach (XmlNode node in nodes)
{
Assert.AreEqual(paramvalue, node.SelectSingleNode("VALUE").InnerText);
}
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:25,代码来源:RequestParameterTests.cs
示例5: inXMLoutXML
public void inXMLoutXML()
{
Console.WriteLine("Before formatParamTests - inXMLoutXML");
// test variants
string formatParam = "XML";
HttpStatusCode expectedCode = HttpStatusCode.OK;
// working data
int inputRating = 0;
string inputText = "";
DnaTestURLRequest myRequest = null;
// run test
myRequest = do_it(formatParam, ref inputText, ref inputRating);
Assert.IsTrue(myRequest.CurrentWebResponse.StatusCode == expectedCode,
"Expecting " + expectedCode + " as response, got " + myRequest.CurrentWebResponse.StatusCode + "\n" + myRequest.CurrentWebResponse.StatusDescription
);
XmlDocument xml = myRequest.GetLastResponseAsXML();
DnaXmlValidator validator = new DnaXmlValidator(xml.InnerXml, testUtils_ratingsAPI._schemaRatingForum);
validator.Validate();
RatingInfo returnedRating = (RatingInfo)StringUtils.DeserializeObject(myRequest.GetLastResponseAsString(), typeof(RatingInfo));
Assert.IsTrue(returnedRating.text == inputText);
Assert.IsTrue(returnedRating.rating == inputRating);
Assert.IsNotNull(returnedRating.User);
Assert.IsTrue(returnedRating.User.UserId == myRequest.CurrentUserID);
Console.WriteLine("After formatParamTests - inXMLoutXML");
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:33,代码来源:formatParamTests_v1.cs
示例6: GuideMLTranslatorTests_PlainTextToGuideML_HttpToClickableLink_Basic
public void GuideMLTranslatorTests_PlainTextToGuideML_HttpToClickableLink_Basic()
{
GuideMLTranslator guideMLTranslator = new GuideMLTranslator();
string guideML;
guideML = guideMLTranslator.PlainTextToGuideML("http://www.bbc.co.uk/");
DnaXmlValidator validator = new DnaXmlValidator(guideML, _schemaUri);
validator.Validate();
Assert.AreEqual("<GUIDE><BODY><LINK HREF=\"http://www.bbc.co.uk/\">http://www.bbc.co.uk/</LINK></BODY></GUIDE>", guideML);
guideML = guideMLTranslator.PlainTextToGuideML("Check out some nonsense here: http://www.bbc.co.uk/dna/mb606/A123");
validator = new DnaXmlValidator(guideML, _schemaUri);
validator.Validate();
Assert.AreEqual("<GUIDE><BODY>Check out some nonsense here: <LINK HREF=\"http://www.bbc.co.uk/dna/mb606/A123\">http://www.bbc.co.uk/dna/mb606/A123</LINK></BODY></GUIDE>", guideML);
guideML = guideMLTranslator.PlainTextToGuideML("http1 = http://www.bbc.co.uk/dna/mb606/A123 http2 http://www.bbc.co.uk/dna/mb606/A456");
validator = new DnaXmlValidator(guideML, _schemaUri);
validator.Validate();
Assert.AreEqual("<GUIDE><BODY>http1 = <LINK HREF=\"http://www.bbc.co.uk/dna/mb606/A123\">http://www.bbc.co.uk/dna/mb606/A123</LINK> http2 <LINK HREF=\"http://www.bbc.co.uk/dna/mb606/A456\">http://www.bbc.co.uk/dna/mb606/A456</LINK></BODY></GUIDE>", guideML);
guideML = guideMLTranslator.PlainTextToGuideML("http1 = http://www.bbc.co.uk/dna/mb606/A123 http2 http://www.bbc.co.uk/dna/mb606/A456 http 3 = http://www.bbc.co.uk/dna/mb606/789 more text");
validator = new DnaXmlValidator(guideML, _schemaUri);
validator.Validate();
Assert.AreEqual("<GUIDE><BODY>http1 = <LINK HREF=\"http://www.bbc.co.uk/dna/mb606/A123\">http://www.bbc.co.uk/dna/mb606/A123</LINK> http2 <LINK HREF=\"http://www.bbc.co.uk/dna/mb606/A456\">http://www.bbc.co.uk/dna/mb606/A456</LINK> http 3 = <LINK HREF=\"http://www.bbc.co.uk/dna/mb606/789\">http://www.bbc.co.uk/dna/mb606/789</LINK> more text</BODY></GUIDE>", guideML);
guideML = guideMLTranslator.PlainTextToGuideML("http://www.bbc.co.uk/dna/mb606 is a good site.");
validator = new DnaXmlValidator(guideML, _schemaUri);
validator.Validate();
Assert.AreEqual("<GUIDE><BODY><LINK HREF=\"http://www.bbc.co.uk/dna/mb606\">http://www.bbc.co.uk/dna/mb606</LINK> is a good site.</BODY></GUIDE>", guideML);
guideML = guideMLTranslator.PlainTextToGuideML("Some text?");
validator = new DnaXmlValidator(guideML, _schemaUri);
validator.Validate();
Assert.AreEqual("<GUIDE><BODY>Some text?</BODY></GUIDE>", guideML);
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:35,代码来源:GuideMLTranslatorTests.cs
示例7: Category_SerializedXML_PassesSchemaValidation
public void Category_SerializedXML_PassesSchemaValidation()
{
var hierarchyDetails = CreateTestCategory();
var objXml = StringUtils.SerializeToXmlUsingXmlSerialiser(hierarchyDetails);
var validator = new DnaXmlValidator(objXml, "Category.xsd");
validator.Validate();
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:7,代码来源:CategoryTest.cs
示例8: UseRedirectParameterTest
public void UseRedirectParameterTest()
{
Console.WriteLine("Before UseRedirectParameterTest");
Mockery mock = new Mockery();
IUser viewingUser = mock.NewMock<IUser>();
Stub.On(viewingUser).GetProperty("UserLoggedIn").Will(Return.Value(true));
Stub.On(viewingUser).GetProperty("Email").Will(Return.Value("[email protected]"));
Stub.On(viewingUser).GetProperty("IsEditor").Will(Return.Value(false));
Stub.On(viewingUser).GetProperty("IsSuperUser").Will(Return.Value(false));
Stub.On(viewingUser).GetProperty("IsBanned").Will(Return.Value(false));
ISite site = mock.NewMock<ISite>();
Stub.On(site).GetProperty("IsEmergencyClosed").Will(Return.Value(false));
Stub.On(site).Method("IsSiteScheduledClosed").Will(Return.Value(false));
Stub.On(site).GetProperty("SiteID").Will(Return.Value(1));
IInputContext context = DnaMockery.CreateDatabaseInputContext();
Stub.On(context).GetProperty("ViewingUser").Will(Return.Value(viewingUser));
Stub.On(context).GetProperty("CurrentSite").Will(Return.Value(site));
DnaMockery.MockTryGetParamString(context,"dnauid", "this is some unique id blah de blah blah2");
//Stub.On(context).Method("TryGetParamString").WithAnyArguments().Will(new TryGetParamStringAction("dnauid","this is some unique id blah de blah blah2"));
Stub.On(context).Method("DoesParamExist").With(Is.EqualTo("dnauid"), Is.Anything).Will(Return.Value(true));
DnaMockery.MockTryGetParamString(context,"dnahostpageurl", "http://www.bbc.co.uk/dna/something");
//Stub.On(context).Method("TryGetParamString").With("dnahostpageurl").Will(new TryGetParamStringAction("dnahostpageurl","http://www.bbc.co.uk/dna/something"));
Stub.On(context).Method("DoesParamExist").With(Is.EqualTo("dnahostpageurl"), Is.Anything).Will(Return.Value(true));
DnaMockery.MockTryGetParamString(context,"dnainitialtitle", "newtitle");
//Stub.On(context).Method("TryGetParamString").With("dnainitialtitle").Will(new TryGetParamStringAction("dnainitialtitle", "newtitle"));
Stub.On(context).Method("DoesParamExist").With(Is.EqualTo("dnainitialtitle"), Is.Anything).Will(Return.Value(true));
Stub.On(context).Method("DoesParamExist").With(Is.EqualTo("dnaerrortype"),Is.Anything).Will(Return.Value(false));
Stub.On(context).Method("DoesParamExist").With(Is.EqualTo("moduserid"), Is.Anything).Will(Return.Value(false));
Stub.On(context).Method("DoesParamExist").With(Is.EqualTo("dnainitialmodstatus"), Is.Anything).Will(Return.Value(false));
Stub.On(context).Method("DoesParamExist").With(Is.EqualTo("dnaforumclosedate"), Is.Anything).Will(Return.Value(false));
Stub.On(context).Method("DoesParamExist").With(Is.EqualTo("dnaforumduration"), Is.Anything).Will(Return.Value(false));
Stub.On(context).Method("GetParamIntOrZero").With(Is.EqualTo("dnafrom"), Is.Anything).Will(Return.Value(0));
Stub.On(context).Method("GetParamIntOrZero").With(Is.EqualTo("dnato"), Is.Anything).Will(Return.Value(0));
Stub.On(context).Method("GetParamIntOrZero").With(Is.EqualTo("dnashow"), Is.Anything).Will(Return.Value(0));
Stub.On(context).Method("GetSiteOptionValueInt").With("CommentForum","DefaultShow").Will(Return.Value(20));
//inputContext.InitialiseFromFile(@"../../testredirectparams.txt", @"../../userdave.txt");
CommentBoxForum forum = new CommentBoxForum(context);
forum.ProcessRequest();
string forumXml = forum.RootElement.InnerXml;
DnaXmlValidator validator = new DnaXmlValidator(forumXml, "CommentBox.xsd");
validator.Validate();
Console.WriteLine("After UseRedirectParameterTest");
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:57,代码来源:CommentBoxAjaxRedirectTest.cs
示例9: ArticleInfoXmlTest
public void ArticleInfoXmlTest()
{
ArticleInfo target = ArticleInfoTest.CreateArticleInfo();
XmlDocument xml = Serializer.SerializeToXml(target);
DnaXmlValidator validator = new DnaXmlValidator(xml.InnerXml, "articleinfo.xsd");
validator.Validate();
//string json = Serializer.SerializeToJson(target);
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:10,代码来源:XmlSchemaTests.cs
示例10: Test1UserListClassTest_CreateNewUsersList
public void Test1UserListClassTest_CreateNewUsersList()
{
UserList userList = new UserList(_InputContext);
Assert.IsTrue(userList.CreateNewUsersList(10, "YEAR", 10, 0, false, "", _InputContext.CurrentSite.SiteID, 0), "Failed creation of list");
XmlElement xml = userList.RootElement;
Assert.IsTrue(xml.SelectSingleNode("USER-LIST") != null, "The xml is not generated correctly!!!");
DnaXmlValidator validator = new DnaXmlValidator(xml.InnerXml, _schemaUri);
validator.Validate();
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:11,代码来源:UserListTests.cs
示例11: SiteOptions_ValidateSiteOptionsXMLFromBBCDNA_ExpectValid
public void SiteOptions_ValidateSiteOptionsXMLFromBBCDNA_ExpectValid()
{
// Get the XML from the c#
DnaTestURLRequest request = new DnaTestURLRequest("h2g2");
request.RequestPage("Status-n?skin=purexml");
XmlDocument xDoc = request.GetLastResponseAsXML();
XmlElement siteoptions = (XmlElement)xDoc.SelectSingleNode("/H2G2/SITE/SITEOPTIONS");
Assert.IsNotNull(siteoptions, "Failed to get the site options from the XML");
DnaXmlValidator validator = new DnaXmlValidator(siteoptions, "SiteOptions.xsd");
validator.Validate();
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:11,代码来源:SiteOptionsTests.cs
示例12: TestAcsRequest
public void TestAcsRequest()
{
DnaTestURLRequest request = new DnaTestURLRequest("haveyoursay");
request.RequestPage(@"acs?dnatitle=New+Comment+Box2&dnaurl=http://local.bbc.co.uk:8000/testpage.shtml&dnauid=552F1F05-74AD-410b-880C-F37B83D8B69A&skin=purexml");
XmlDocument doc = request.GetLastResponseAsXML();
DnaXmlValidator validator = new DnaXmlValidator(doc.InnerXml, "H2G2CommentBoxFlat.xsd");
validator.Validate();
Assert.IsTrue(doc.SelectSingleNode("/H2G2/SERVERNAME") != null, "No SERVERNAME element found");
Assert.IsTrue(doc.SelectSingleNode("/H2G2/TIMEFORPAGE") != null, "No TIMEFORPAGE element found");
Assert.IsTrue(doc.SelectSingleNode("/H2G2/USERAGENT") != null, "No USERAGENT element found");
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:11,代码来源:TestCommonPageXml.cs
示例13: AddResults
public void AddResults()
{
_pollResults.Add(Poll.UserStatus.USERSTATUS_LOGGEDIN, 1, "blah", "1");
_pollResults.Add(Poll.UserStatus.USERSTATUS_LOGGEDIN, 2, "blah2", "2");
_pollResults.Add(Poll.UserStatus.USERSTATUS_HIDDEN, 1, "hidden", "0");
XmlElement xml = _pollResults.GetXml();
DnaXmlValidator validator = new DnaXmlValidator(xml, "OptionList.xsd");
validator.Validate();
Assert.IsTrue(xml.OuterXml.Equals("<OPTION-LIST><USERSTATUS TYPE=\"1\"><OPTION INDEX=\"blah\" COUNT=\"1\" /><OPTION INDEX=\"blah2\" COUNT=\"2\" /></USERSTATUS><USERSTATUS TYPE=\"2\"><OPTION INDEX=\"hidden\" COUNT=\"0\" /></USERSTATUS></OPTION-LIST>"), "AddThreeResults: Xml is not what we were expecting");
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:PollResultsTest.cs
示例14: TestThreadSearchPhraseNoPhrase
public void TestThreadSearchPhraseNoPhrase()
{
Console.WriteLine("ThreadSearchPhraseTest");
_request.RequestPage("tsp?skin=purexml&clear_templates=1");
Console.WriteLine("ThreadSearchPhraseTest");
XmlDocument xml = _request.GetLastResponseAsXML();
Assert.IsTrue(xml.SelectSingleNode(@"H2G2/THREADSEARCHPHRASE/PHRASES[@COUNT=0]") != null, "Incorrect Phrase count. Expecting 0");
DnaXmlValidator validator = new DnaXmlValidator(xml.SelectSingleNode("H2G2/THREADSEARCHPHRASE").OuterXml, "threadsearchphrase.xsd");
validator.Validate();
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:ThreadSearchPhraseTests.cs
示例15: inXMLoutXML
public void inXMLoutXML()
{
Console.WriteLine("Before formatParam - inXMLoutXML");
// test variant data
string formatParam = "XML";
HttpStatusCode expectedResponseCode = HttpStatusCode.OK;
// consistent input data
string id = "";
string title = "";
string parentUri = "";
string mimeType = "text/xml";
string filename = "";
string postXML = testUtils_CommentsAPI.makePostXml(ref id, ref title, ref parentUri);
// working data
int newSiteCount = 0;
DnaTestURLRequest request;
XmlDocument xml;
DnaXmlValidator validator;
BBC.Dna.Api.CommentForum returnedForum;
//go
request = makeRequest(formatParam, filename, postXML, mimeType);
Assert.IsTrue(
request.CurrentWebResponse.StatusCode == expectedResponseCode,
"HTTP repsonse. Expected:" + expectedResponseCode + " actually got " + request.CurrentWebResponse.StatusCode
);
newSiteCount = testUtils_CommentsAPI.countForums(testUtils_CommentsAPI.sitename);
Assert.IsTrue(newSiteCount == (testUtils_CommentsAPI.runningForumCount + 1));
testUtils_CommentsAPI.runningForumCount = newSiteCount;
xml = request.GetLastResponseAsXML();
validator = new DnaXmlValidator(xml.InnerXml, testUtils_CommentsAPI._schemaCommentForum);
validator.Validate();
returnedForum =
(BBC.Dna.Api.CommentForum)StringUtils.DeserializeObject(request.GetLastResponseAsString(), typeof(BBC.Dna.Api.CommentForum)
);
Assert.IsTrue(returnedForum.Id == id);
Assert.IsTrue(returnedForum.Title == title);
Assert.IsTrue(returnedForum.ParentUri == parentUri);
Assert.IsTrue(returnedForum.commentList.TotalCount == 0);
Console.WriteLine("After formatParam - inXMLoutXML");
} // ends inXMLoutXML
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:53,代码来源:formatParamTest_v1.cs
示例16: Test02ArticleSearchWithinDateRangeTest
public void Test02ArticleSearchWithinDateRangeTest()
{
Console.WriteLine("Test02ArticleSearchDateRangeTest");
_request.RequestAspxPage("ArticleSearchPage.aspx", @"skip=0&show=10&contenttype=-1&datesearchtype=1&skin=purexml&startday=1&startmonth=1&startyear=2006&&endday=1&endmonth=1&endyear=2007");
Console.WriteLine("After Test02ArticleSearchDateRangeTest");
XmlDocument xml = _request.GetLastResponseAsXML();
Assert.IsTrue(xml.SelectSingleNode("H2G2/ARTICLESEARCH[@DATESEARCHTYPE=1]") != null, "The within date range article search page has not been generated correctly!!!");
DnaXmlValidator validator = new DnaXmlValidator(xml.InnerXml, _schemaUri);
validator.Validate();
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:12,代码来源:ArticleSearchPageTests.cs
示例17: Test1UserComplaintPage
public void Test1UserComplaintPage()
{
DnaTestURLRequest request = new DnaTestURLRequest("haveyoursay");
request.SetCurrentUserNormal();
request.UseEditorAuthentication = false;
request.RequestPage("UserComplaintPage?skin=purexml" + "&postid=" + Convert.ToString(_postId) );
XmlDocument doc = request.GetLastResponseAsXML();
//Check XML against Schema.
DnaXmlValidator validator = new DnaXmlValidator(doc.InnerXml, "H2G2UserComplaintFlat.xsd");
validator.Validate();
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:13,代码来源:UserComplaintPageTests.cs
示例18: Test2TestSiteID
public void Test2TestSiteID()
{
Console.WriteLine("Test2TestSiteID");
Assert.AreEqual(_testSite.SiteID, 1);
SiteXmlBuilder siteXml = new SiteXmlBuilder(_inputcontext);
XmlNode testnode = siteXml.GenerateXml(null, _testSite);
DnaXmlValidator validator = new DnaXmlValidator(testnode.OuterXml, _schemaUri);
validator.Validate();
if (testnode != null)
{
Assert.AreEqual(testnode.Attributes["ID"].InnerText, "1", "Site ID Attribute Xml incorrect");
}
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:13,代码来源:SiteTests.cs
示例19: Test3TestSiteName
public void Test3TestSiteName()
{
Console.WriteLine("Test3TestSiteName");
Assert.AreEqual(_testSite.SiteName, "h2g2");
SiteXmlBuilder siteXml = new SiteXmlBuilder(_inputcontext);
XmlNode testnode = siteXml.GenerateXml(null, _testSite);
DnaXmlValidator validator = new DnaXmlValidator(testnode.OuterXml, _schemaUri);
validator.Validate();
if (testnode != null)
{
Assert.AreEqual(testnode.SelectSingleNode("NAME").InnerText, "h2g2", "Site Name Xml incorrect");
}
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:13,代码来源:SiteTests.cs
示例20: TestModeratorManagementPageXml
public void TestModeratorManagementPageXml()
{
DnaTestURLRequest request = new DnaTestURLRequest("moderation");
request.SetCurrentUserSuperUser();
request.UseEditorAuthentication = true;
request.RequestPage(@"ModeratorManagement?skin=purexml");
XmlDocument xml = request.GetLastResponseAsXML();
Assert.IsTrue(xml.SelectSingleNode("H2G2") != null, "The page does not exist!!!");
DnaXmlValidator validator = new DnaXmlValidator(xml.InnerXml, "H2G2ModeratorManagementPage.xsd");
validator.Validate();
}
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:13,代码来源:ModeratorManagementPageTests.cs
注:本文中的Tests.DnaXmlValidator类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论