本文整理汇总了C#中FileSet.Add方法的典型用法代码示例。如果您正苦于以下问题:C# FileSet.Add方法的具体用法?C# FileSet.Add怎么用?C# FileSet.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSet
的用法示例。
在下文中一共展示了FileSet.Add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldAddMultipleFiles
public void ShouldAddMultipleFiles()
{
var fileset = new FileSet();
fileset.Add(new List<File>
{
new File(@"M:\Shows\Lost\101.avi"),
new File(@"M:\Shows\Lost\102.avi"),
});
Assert.NotNull(fileset.Files.SingleOrDefault(f => f.Path == @"M:\Shows\Lost\101.avi"));
Assert.NotNull(fileset.Files.SingleOrDefault(f => f.Path == @"M:\Shows\Lost\102.avi"));
}
示例2: ShouldNotAddIgnoredFiles
public void ShouldNotAddIgnoredFiles()
{
var fileset = new FileSet();
fileset.Add(new List<File>
{
new File(@"M:\Shows\Lost\lost.nfo"),
new File(@"M:\Shows\Lost\101.avi"),
new File(@"M:\Shows\Lost\cast.jpeg"),
});
Assert.AreEqual(1, fileset.Files.Count());
Assert.NotNull(fileset.Files.SingleOrDefault(f => f.Path == @"M:\Shows\Lost\101.avi"));
}
示例3: ShouldFindFileWhenProvidingFullPath
public void ShouldFindFileWhenProvidingFullPath()
{
var fileset = new FileSet();
fileset.Add(new List<File>
{
new File(@"M:\Shows\Lost\101.avi"),
new File(@"M:\Shows\Lost\102.avi"),
});
var matches = fileset.Find(@"M:\Shows\Lost\101.avi");
Assert.AreEqual(1, matches.Count());
Assert.NotNull(matches.SingleOrDefault(f => f.Path == @"M:\Shows\Lost\101.avi"));
}
示例4: ShouldFindAllFilesThatMatchStars
public void ShouldFindAllFilesThatMatchStars()
{
var fileset = new FileSet();
fileset.Add(new List<File>
{
new File(@"M:\Shows\Lost\101.avi"),
new File(@"M:\Shows\Lost\102.avi"),
new File(@"M:\Shows\Dexter\121.avi"),
});
var matches = fileset.Find(@"1*1");
Assert.AreEqual(2, matches.Count());
Assert.NotNull(matches.SingleOrDefault(f => f.Path == @"M:\Shows\Lost\101.avi"));
Assert.NotNull(matches.SingleOrDefault(f => f.Path == @"M:\Shows\Dexter\121.avi"));
}
示例5: GetPendingOrderFileSet
public FileSet GetPendingOrderFileSet(bool forceRefresh)
{
FileSet fs = new FileSet();
var allPendingOrders = this.GetAllPendingOrders(forceRefresh);
foreach (var order in allPendingOrders.Values)
{
var file = CooToPendingOrderFile(order);
fs.Add(order.FileKey, file);
}
return fs;
}
示例6: ShouldNotAddIgnoredFilesWithUpperCaseExtension
public void ShouldNotAddIgnoredFilesWithUpperCaseExtension()
{
var fileset = new FileSet();
fileset.Add(new List<File>
{
new File(@"M:\Shows\Lost\lost.TXT"),
new File(@"M:\Shows\Lost\101.avi"),
});
Assert.AreEqual(1, fileset.Files.Count());
Assert.NotNull(fileset.Files.SingleOrDefault(f => f.Path == @"M:\Shows\Lost\101.avi"));
}
示例7: ShouldRemoveWholeFolder
public void ShouldRemoveWholeFolder()
{
var fileset = new FileSet();
fileset.Add(new List<File>
{
new File(@"M:\Shows\Lost\101.avi"),
new File(@"M:\Shows\Lost\102.avi"),
new File(@"M:\Shows\Dexter\121.avi"),
});
fileset.Remove(@"M:\Shows\Lost");
Assert.AreEqual(1, fileset.Files.Count());
Assert.NotNull(fileset.Files.SingleOrDefault(f => f.Path == @"M:\Shows\Dexter\121.avi"));
}