Improved unit test names for the XML helper class
git-svn-id: file:///srv/devel/repo-conversion/nusu@285 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
23fe4cfd37
commit
4b94bdd1a5
|
@ -171,7 +171,7 @@ namespace Nuclex.Support {
|
||||||
/// Verifies that an exception is thrown when a schema fails to load
|
/// Verifies that an exception is thrown when a schema fails to load
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestThrowOnInvalidSchema() {
|
public void LoadSchemaThrowsOnInvalidSchema() {
|
||||||
using(
|
using(
|
||||||
TempFileKeeper tempFile = new TempFileKeeper(brokenSchemaXml)
|
TempFileKeeper tempFile = new TempFileKeeper(brokenSchemaXml)
|
||||||
) {
|
) {
|
||||||
|
@ -183,7 +183,7 @@ namespace Nuclex.Support {
|
||||||
/// Verifies that an exception is thrown when a schema contains a syntax error
|
/// Verifies that an exception is thrown when a schema contains a syntax error
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestThrowOnSyntaxErrorSchema() {
|
public void LoadSchemaThrowsOnSyntaxErrors() {
|
||||||
using(
|
using(
|
||||||
TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml)
|
TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml)
|
||||||
) {
|
) {
|
||||||
|
@ -196,7 +196,7 @@ namespace Nuclex.Support {
|
||||||
/// when the schema is not a valid XML document
|
/// when the schema is not a valid XML document
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFailOnTryLoadNonExistingFile() {
|
public void TryLoadSchemaHandlesMissingFiles() {
|
||||||
XmlSchema schema;
|
XmlSchema schema;
|
||||||
Assert.IsFalse(XmlHelper.TryLoadSchema("-- hello world --", out schema));
|
Assert.IsFalse(XmlHelper.TryLoadSchema("-- hello world --", out schema));
|
||||||
Assert.IsNull(schema);
|
Assert.IsNull(schema);
|
||||||
|
@ -207,7 +207,7 @@ namespace Nuclex.Support {
|
||||||
/// when the schema is not a valid XML document
|
/// when the schema is not a valid XML document
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFailOnTryLoadBrokenSchema() {
|
public void TryLoadSchemaHandlesBrokenSchemas() {
|
||||||
using(
|
using(
|
||||||
TempFileKeeper tempFile = new TempFileKeeper(brokenSchemaXml)
|
TempFileKeeper tempFile = new TempFileKeeper(brokenSchemaXml)
|
||||||
) {
|
) {
|
||||||
|
@ -222,7 +222,7 @@ namespace Nuclex.Support {
|
||||||
/// when the schema contains a syntax error
|
/// when the schema contains a syntax error
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFailOnTryLoadSyntaxErrorSchema() {
|
public void TryLoadSchemaHandlesSyntaxErrors() {
|
||||||
using(
|
using(
|
||||||
TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml)
|
TempFileKeeper tempFile = new TempFileKeeper(syntaxErrorSchemaXml)
|
||||||
) {
|
) {
|
||||||
|
@ -234,7 +234,7 @@ namespace Nuclex.Support {
|
||||||
|
|
||||||
/// <summary>Tests whether a normal, valid schema can be loaded successfully</summary>
|
/// <summary>Tests whether a normal, valid schema can be loaded successfully</summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadSchema() {
|
public void SchemasCanBeLoadedFromFiles() {
|
||||||
using(
|
using(
|
||||||
TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml)
|
TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml)
|
||||||
) {
|
) {
|
||||||
|
@ -244,7 +244,7 @@ namespace Nuclex.Support {
|
||||||
|
|
||||||
/// <summary>Tests whether a normal, valid schema can be loaded successfully</summary>
|
/// <summary>Tests whether a normal, valid schema can be loaded successfully</summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestTryLoadSchema() {
|
public void TryLoadSchemaCanLoadSchemas() {
|
||||||
using(
|
using(
|
||||||
TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml)
|
TempFileKeeper tempFile = new TempFileKeeper(pointsSchemaXml)
|
||||||
) {
|
) {
|
||||||
|
@ -258,7 +258,7 @@ namespace Nuclex.Support {
|
||||||
/// Verifies that an exception is thrown when an invalid XML document is loaded
|
/// Verifies that an exception is thrown when an invalid XML document is loaded
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFailOnLoadInvalidDocument() {
|
public void LoadingInvalidDocumentThrows() {
|
||||||
using(TextReader schemaReader = new StringReader(pointsSchemaXml)) {
|
using(TextReader schemaReader = new StringReader(pointsSchemaXml)) {
|
||||||
XmlSchema schema = XmlHelper.LoadSchema(schemaReader);
|
XmlSchema schema = XmlHelper.LoadSchema(schemaReader);
|
||||||
using(
|
using(
|
||||||
|
@ -275,7 +275,7 @@ namespace Nuclex.Support {
|
||||||
/// Verifies that an exception is thrown when a nonconformant XML document is loaded
|
/// Verifies that an exception is thrown when a nonconformant XML document is loaded
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFailOnLoadNonConformingDocument() {
|
public void SchemaValidationFailureCausesException() {
|
||||||
using(TextReader schemaReader = new StringReader(pointsSchemaXml)) {
|
using(TextReader schemaReader = new StringReader(pointsSchemaXml)) {
|
||||||
XmlSchema schema = XmlHelper.LoadSchema(schemaReader);
|
XmlSchema schema = XmlHelper.LoadSchema(schemaReader);
|
||||||
using(
|
using(
|
||||||
|
@ -292,7 +292,7 @@ namespace Nuclex.Support {
|
||||||
/// Tests whether a normal, conformant XML document can be loaded successfully
|
/// Tests whether a normal, conformant XML document can be loaded successfully
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLoadConformingDocument() {
|
public void LoadedDocumentIsValidatedAgainstSchema() {
|
||||||
using(TextReader schemaReader = new StringReader(pointsSchemaXml)) {
|
using(TextReader schemaReader = new StringReader(pointsSchemaXml)) {
|
||||||
XmlSchema schema = XmlHelper.LoadSchema(schemaReader);
|
XmlSchema schema = XmlHelper.LoadSchema(schemaReader);
|
||||||
using(
|
using(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user