-
Notifications
You must be signed in to change notification settings - Fork 157
SubPathConstraint
Charlie Poole edited this page Jan 31, 2016
·
7 revisions
SubPathConstraint
tests that one path is under another path.
Assert.That( "/folder1/./junk/../folder2",
Is.SubPath( "/folder1/folder2" ) );
Assert.That( "/folder1/junk/folder2",
Is.Not.SubPath( "/folder1/folder2" ) );
Assert.That( @"C:\folder1\folder2\folder3",
Is.SubPath( @"C:\Folder1\Folder2/Folder3" ).IgnoreCase );
Assert.That( "/folder1/folder2/folder3",
Is.Not.SubPath( "/Folder1/Folder2/Folder3" ).RespectCase );
####Notes:
-
Path constraints perform tests on paths, without reference to any actual files or directories. This allows testing paths that are created by an application for reference or later use, without any effect on the environment.
-
Path constraints are intended to work across multiple file systems, and convert paths to a canonical form before comparing them.
-
It is usually not necessary to know the file system of the paths in order to compare them. Where necessary, the programmer may use the IgnoreCase and RespectCase modifiers to provide behavior other than the system default.
####See also...
Copyright (c) 2018 The NUnit Project - Licensed under CC BY-NC-SA 4.0
-
NUnit
-
Release Notes
-
License
- Getting Started
- Writing Tests
- Running Tests
- Extending NUnit
- Technical Notes
-
Release Notes
- NUnit Xamarin Runners
- VS Test Adapter
- VS Test Generator
- NUnit Analyzers