@@ -76,33 +76,34 @@ public void GetFileFromSubDirectoryTest_UsingShareObjectWithPath()
76
76
{
77
77
var share = this . MockChannel . GetShareReference ( ShareName ) ;
78
78
var dir = share . GetRootDirectoryReference ( ) . GetDirectoryReference ( "dir" ) ;
79
- var listItems = Enumerable . Range ( 0 , 10 ) . Select ( x => dir . GetFileReference ( string . Format ( "file{0}" , x ) ) ) . Cast < IListFileItem > ( )
80
- . Concat ( Enumerable . Range ( 0 , 5 ) . Select ( x => dir . GetDirectoryReference ( string . Format ( "dir{0}" , x ) ) ) ) . ToArray ( ) ;
81
79
82
- this . ListFilesAndAssertResults (
83
- ( ) => this . CmdletInstance . RunCmdlet (
84
- Constants . ShareParameterSetName ,
85
- new KeyValuePair < string , object > ( "Share" , share ) ,
86
- new KeyValuePair < string , object > ( "Path" , dir . Name ) ) ,
87
- listItems ,
88
- dir ) ;
80
+ this . MockChannel . SetsAvailableDirectories ( dir . Name ) ;
81
+
82
+ this . CmdletInstance . RunCmdlet (
83
+ Constants . ShareNameParameterSetName ,
84
+ new KeyValuePair < string , object > ( "ShareName" , ShareName ) ,
85
+ new KeyValuePair < string , object > ( "Path" , dir . Name ) ) ;
86
+
87
+ List < IListFileItem > fileList = new List < IListFileItem > ( ) ;
88
+ fileList . Add ( dir ) ;
89
+ this . MockCmdRunTime . OutputPipeline . AssertListFileItems ( fileList ) ;
89
90
}
90
91
91
92
[ TestMethod ]
92
93
public void GetFileFromSubDirectoryTest_UsingShareNameWithPath ( )
93
94
{
94
95
var share = this . MockChannel . GetShareReference ( ShareName ) ;
95
96
var dir = share . GetRootDirectoryReference ( ) . GetDirectoryReference ( "dir" ) ;
96
- var listItems = Enumerable . Range ( 0 , 10 ) . Select ( x => dir . GetFileReference ( string . Format ( "file{0}" , x ) ) ) . Cast < IListFileItem > ( )
97
- . Concat ( Enumerable . Range ( 0 , 5 ) . Select ( x => dir . GetDirectoryReference ( string . Format ( "dir{0}" , x ) ) ) ) . ToArray ( ) ;
97
+ this . MockChannel . SetsAvailableDirectories ( dir . Name ) ;
98
98
99
- this . ListFilesAndAssertResults (
100
- ( ) => this . CmdletInstance . RunCmdlet (
99
+ this . CmdletInstance . RunCmdlet (
101
100
Constants . ShareNameParameterSetName ,
102
101
new KeyValuePair < string , object > ( "ShareName" , ShareName ) ,
103
- new KeyValuePair < string , object > ( "Path" , dir . Name ) ) ,
104
- listItems ,
105
- dir ) ;
102
+ new KeyValuePair < string , object > ( "Path" , dir . Name ) ) ;
103
+
104
+ List < IListFileItem > fileList = new List < IListFileItem > ( ) ;
105
+ fileList . Add ( dir ) ;
106
+ this . MockCmdRunTime . OutputPipeline . AssertListFileItems ( fileList ) ;
106
107
}
107
108
108
109
[ TestMethod ]
0 commit comments