当前位置: 首页>>代码示例>>Golang>>正文


Golang utils.TestVisitor类代码示例

本文整理汇总了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
}
开发者ID:apognu,项目名称:xml,代码行数:25,代码来源:extension_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:generator_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:category_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:textconstruct_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:logo_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:channel_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:source_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:cloud_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:item_test.go

示例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
}
开发者ID:apognu,项目名称:xml,代码行数:15,代码来源:icon_test.go


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