Gets or sets the path of a manifest resource from which the contents should be read.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public string ResourcePath { get; set; }
Visual Basic (Declaration)
Public Property ResourcePath As String

Remarks

The path will be resolved within the assembly containing the ResourceScope type or the test fixture type if none if provided.

During resolution, a resource name is constructed from the resource path by translating backslashes to periods. If the named resource is found within the scoped assembly manifest, it is used. Otherwise, the name is prepended with the scoped type's namespace and second lookup is attempted. If this final attempt fails, then an error is raised at runtime.

Examples:

  • If the ResourceScope is MyNamespace.MyType within assembly MyAssembly.dll and if ResourcePath is "Resources\Image.gif", then resolution will first check whether Resources.Image.gif in MyAssembly.dll is a valid resource. If not found, it will consider MyNamespace.Resources.Image.gif. If still not found, then a runtime error will be raised.
  • If no ResourceScope is provided, then the containing test fixture type will be used as the resource scope. The above resolution strategy still applies.

It is an error to specify more than one content source property.

See Also