Example #1
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 #2
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 #3
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);
        }