public void Push_And_Pull() { SnapshotRepository repo = new DirectorySnapshotRepository(this.TestFolder); string testContent = "Hello 123456 0815 4711"; string testkey = "xxyy"; using (DisposableFile sourceFile = DisposableFile.GetTempFile()) { using (DisposableFile destFile = DisposableFile.GetTempFile()) { System.IO.File.WriteAllText(sourceFile.Path, testContent); repo.Push(testkey, sourceFile.Path); Assert.True(repo.TryPull(testkey, destFile.Path)); Assert.Equal(testContent, File.ReadAllText(destFile.Path)); } } }
public void Try_On_Empty() { SnapshotRepository repo = new DirectorySnapshotRepository(this.TestFolder); Assert.False(repo.TryPull("holla", System.IO.Path.GetTempFileName())); }