Permalink
Browse files

Add a simple test for Utility.CreateRecursive

  • Loading branch information...
1 parent 4890666 commit caa21bc777d66eb42e81291c01cecf76087a3012 @aroben aroben committed May 24, 2012
@@ -64,6 +64,7 @@
<Compile Include="EncryptedBlobCacheFixture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utility.cs" />
+ <Compile Include="UtilityTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config">
@@ -27,7 +27,7 @@ public static void DeleteDirectory(string directoryPath)
foreach (var dir in dirs)
{
- DeleteDirectory(di.FullName);
+ DeleteDirectory(dir.FullName);
}
File.SetAttributes(directoryPath, FileAttributes.Normal);
@@ -0,0 +1,23 @@
+using System.IO;
+using Xunit;
+
+namespace Akavache.Tests
+{
+ public class UtilityTests
+ {
+ public class TheCreateRecursiveMethod
+ {
+ [Fact]
+ public void CreatesDirectories()
+ {
+ string path;
+ using (Utility.WithEmptyDirectory(out path))
+ {
+ var dir = new DirectoryInfo(Path.Combine(path, @"foo\bar\baz"));
+ dir.CreateRecursive();
+ Assert.True(dir.Exists);
+ }
+ }
+ }
+ }
+}
@@ -34,3 +34,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: InternalsVisibleTo("Akavache.Tests")]

0 comments on commit caa21bc

Please sign in to comment.