private static void CreateTemporaryDirectory(ITempStorage tempStorage) { using ITempDirectory tempDir = tempStorage.NewTempDirectory(); using ITempFile tempFile = tempDir.NewTempFile(); tempFile.WriteAllText("some file content"); using ITempDirectory subDir = tempDir.NewTempDirectory(); }
public void Getting_a_new_temp_directory_should_create_a_new_subdirectory_in_the_root_directory() { var expected = Substitute.For <ITempDirectory>(); rootDirectoryMock.NewTempDirectory().Returns(expected); var actual = subject.NewTempDirectory(); actual.Should().BeSameAs(expected); }
public ITempDirectory NewTempDirectory() { return(directory.NewTempDirectory()); }