private static byte[] GetMetadataBytes(string originalFilePath, long fileSize, DateTime removingDate) { var builder = new WindowsRemovedFileMetadataBuilder() .WithFileSize(fileSize) .WithRemovingDateTime(removingDate) .WithFilePath(originalFilePath); return(builder.Build()); }
private byte[] GetMetadataBytes(string originalFilePath, string trashCanFilePath, DateTime removingDate) { var fileModel = _fileService.GetFile(trashCanFilePath); var builder = new WindowsRemovedFileMetadataBuilder() .WithFileSize(fileModel.SizeBytes) .WithRemovingDateTime(removingDate) .WithFilePath(originalFilePath); return(builder.Build()); }
public void TestMetadataBuilder() { const string filePath = "C://test.txt"; var builder = new WindowsRemovedFileMetadataBuilder() .WithFilePath(filePath) .WithRemovingDateTime(DateTime.Now) .WithFileSize(42); var metadata = builder.Build(); Assert.NotNull(metadata); Assert.Equal(30 + filePath.Length * 2, metadata.Length); }