A-A+

【NUnit】DirectoryAssert (NUnit 2.5)

2014年12月27日 Nunit 【NUnit】DirectoryAssert (NUnit 2.5)已关闭评论 阅读 472 次

DirectoryAssert类提供了一系列方法来比较文件系统目录,DirectoryInfo或者指定目录路径的string格式的参数。

DirectoryAssert.AreEqual() and DirectoryAssert.AreNotEqual() 比较两个目录是否相等。如果目录有相同的FullName, Attributes, CreationTime and LastAccessTime则认为是相等。

Note:如果不满足以上条件即使两个不同目录包含相同的文件也不相等

DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual );
DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual, 
                string message );
DirectoryAssert.AreEqual( DirectoryInfo expected, DirectoryInfo actual,
                string message, params object[] args );

DirectoryAssert.AreEqual( string expected, string actual );
DirectoryAssert.AreEqual( string expected, string actual, string message );
DirectoryAssert.AreEqual( string expected, string actual,
                string message, params object[] args );

DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual );
DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual, 
                string message );
DirectoryAssert.AreNotEqual( DirectoryInfo expected, DirectoryInfo actual,
                string message, params object[] args );

DirectoryAssert.AreNotEqual( string expected, string actual );
DirectoryAssert.AreNotEqual( string expected, string actual,string message );
DirectoryAssert.AreNotEqual( string expected, string actual,
                string message, params object[] args );

DirectoryAssert.IsEmpty() and DirectoryAssert.IsNotEmpty() 检测指定的目录是否为empty。

DirectoryAssert.IsEmpty( DirectoryInfo directory );
DirectoryAssert.IsEmpty( DirectoryInfo directory, string message );
DirectoryAssert.IsEmpty( DirectoryInfo directory,
                string message, params object[] args );

DirectoryAssert.IsEmpty( string directory );
DirectoryAssert.IsEmpty( string directory, string message );
DirectoryAssert.IsEmpty( string directory,string message, params object[] args );

DirectoryAssert.IsNotEmpty( DirectoryInfo directory );
DirectoryAssert.IsNotEmpty( DirectoryInfo directory, string message );
DirectoryAssert.IsNotEmpty( DirectoryInfo directory,
                string message, params object[] args );

DirectoryAssert.IsNotEmpty( string directory );
DirectoryAssert.IsNotEmpty( string directory, string message );
DirectoryAssert.IsNotEmpty( string directory,string message, params object[] args );

DirectoryAssert.IsWithin() and DirectoryAssert.IsNotWithin()检测第二个目录是否是第一个目录的直接或者间接子目录。

DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual );
DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual,
                string message );
DirectoryAssert.IsWithin( DirectoryInfo expected, DirectoryInfo actual,
                string message, params object[] args );

DirectoryAssert.IsWithin( string expected, string actual );
DirectoryAssert.IsWithin( string expected, string actual,string message );
DirectoryAssert.IsWithin( string expected, string actual,
                string message, params object[] args );

DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual );
DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual,
                string message );
DirectoryAssert.IsNotWithin( DirectoryInfo expected, DirectoryInfo actual,
                string message, params object[] args );

DirectoryAssert.IsNotWithin( string expected, string actual );
DirectoryAssert.IsNotWithin( string expected, string actual,string message );
DirectoryAssert.IsNotWithin( string expected, string actual,
                string message, params object[] args );
标签:

评论已关闭!

Copyright © 极品飞鸽 保留所有权利.   Theme  Ality 蜀ICP备14015766号-1

用户登录

分享到: