Example #1
0
 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);
 }
Example #2
0
 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.";
 }
Example #3
0
 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.";
 }
Example #4
0
 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);
 }
Example #5
0
        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);
        }