public SyncableFileDto(SyncableFileLocal inf, int fileID) : this() { title = inf.Name; field_private_file = und.Fids(fileID); field_semantic_ver = und.Values(inf.Version); field_uploaded_bytes_length = und.Values(inf.Size); field_sha1_hash = und.Values(inf.SHA1); }
public RemoteVsLocalFile(string filename, SyncableFileRemote remoteFile, SyncableFileLocal localFile, SyncDirection syncDirection) { Filename = filename; Remote = remoteFile; Local = localFile; Status = "Comparing..."; Comparison = GetComparison(Remote, Local, syncDirection); Status = "Idle."; }
private RemoteVsLocalFile RemVsLoc(SyncableFileLocal locFile, SyncableFileRemote remNode, SyncDirection syncDirection) { //return new RemoteVsLocalFile(locFile?.Name ?? remNode.Name) //{ // Local = locFile, // Remote = RemoteFileInfo(remNode) //}; var fName = locFile?.Name ?? remNode.Name; var remFile = RemoteFileInfo(remNode); return new RemoteVsLocalFile(fName, remFile, locFile, syncDirection); }
public void Result_Same() { var rem = new SyncableFileRemote(); var loc = new SyncableFileLocal(); loc.Size = rem.Size = 123; loc.Version = rem.Version = "v.456"; loc.SHA1 = rem.SHA1 = "abc-def-ghi"; var sut = new RemoteVsLocalFile("file.txt", rem, loc, SyncDirection.Upload); sut.Comparison.MustBe(FileDiff.Same, "result state"); sut.OddProperty.MustBe(null, "odd property"); sut.NextStep.MustBe(FileTask.Ignore); sut.Target.MustBe(Target.Both); }