本文整理匯總了Golang中github.com/apognu/xml/utils.TestVisitor類的典型用法代碼示例。如果您正苦於以下問題:Golang TestVisitor類的具體用法?Golang TestVisitor怎麽用?Golang TestVisitor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了TestVisitor類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: _TestThrEntryToTestVisitor
func _TestThrEntryToTestVisitor(t testThrEntry) xmlutils.TestVisitor {
customError := xmlutils.NewErrorChecker(xmlutils.DisableAllError)
customError.EnableErrorChecking("in-reply-to", atom.MissingAttribute)
customError.EnableErrorChecking("in-reply-to", atom.AttributeDuplicated)
customError.EnableErrorChecking("entry", atom.AttributeDuplicated)
customError.EnableErrorChecking("link", LinkNotReplies)
customError.EnableErrorChecking("link", NotInLinkElement)
customError.EnableErrorChecking(xmlutils.AllError, atom.NotPositiveNumber)
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedThrEntry,
VisitorConstructor: testThrEntryConstructor,
Validator: testThrEntryValidator,
CustomError: &customError,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例2: testGeneratorToTestVisitor
func testGeneratorToTestVisitor(t testGenerator) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedGenerator,
VisitorConstructor: testGeneratorConstructor,
Validator: testGeneratorValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例3: _TestCategoryToTestVisitor
func _TestCategoryToTestVisitor(t testCategory) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedCategory,
VisitorConstructor: testCategoryConstructor,
Validator: testCategoryValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例4: _TestTextConstructToTestVisitor
func _TestTextConstructToTestVisitor(t testTextConstruct) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedTextConstruct,
VisitorConstructor: testTextConstructConstructor,
Validator: testTextConstructValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例5: testLogoToTestVisitor
func testLogoToTestVisitor(t testLogo) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedLogo,
VisitorConstructor: testLogoConstructor,
Validator: testLogoValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例6: _TestChannelToTestVisitor
func _TestChannelToTestVisitor(t testChannel) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedChannel,
VisitorConstructor: testChannelConstructor,
Validator: testChannelValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例7: _TestSourceToTestVisitor
func _TestSourceToTestVisitor(t testSource) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedSource,
VisitorConstructor: testSourceConstructor,
Validator: testSourceValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例8: _TestCloudToTestVisitor
func _TestCloudToTestVisitor(t testCloud) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedCloud,
VisitorConstructor: testCloudConstructor,
Validator: testCloudValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例9: _TestItemToTestVisitor
func _TestItemToTestVisitor(t testItem) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedItem,
VisitorConstructor: testItemConstructor,
Validator: testItemValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}
示例10: testIconToTestVisitor
func testIconToTestVisitor(t testIcon) xmlutils.TestVisitor {
testVisitor := xmlutils.TestVisitor{
XML: t.XML,
ExpectedError: nil,
ExpectedVisitor: t.ExpectedIcon,
VisitorConstructor: testIconConstructor,
Validator: testIconValidator,
}
if t.ExpectedError != nil {
testVisitor.ExpectedError = t.ExpectedError
}
return testVisitor
}