Beispiel #1
0
        public void No_conflict_with_nonexistent_local_file()
        {
            var sut = new ConflictMediator();

            RepoFile result = null;
            var remote = new RepoFile { TimeStamp = new DateTime(2000, 12, 31, 12, 13, 14, 789) };
            sut.DetectUpdateConflct(null, null, remote, _ => result = _, null);

            Equalidator.AreEqual(remote, result);
        }
Beispiel #2
0
        public void Conflict_with_new_file()
        {
            var sut = new ConflictMediator();

            RepoFile result = null;
            var current = new RepoFile { TimeStamp = new DateTime(2000, 7, 28, 9, 10, 11, 456) };
            var remote = new RepoFile { TimeStamp = new DateTime(2000, 12, 31, 12, 13, 14, 789) };
            sut.DetectUpdateConflct(null, current, remote, null, _ => result = _);

            Equalidator.AreEqual(remote, result);
        }
Beispiel #3
0
        public void No_conflict()
        {
            var sut = new ConflictMediator();

            RepoFile result = null;
            var local = new RepoFile {TimeStamp = new DateTime(2000,5,12,10,11,12, 123)};
            var current = new RepoFile {TimeStamp = new DateTime(2000,5,12,10,11,12,456)};
            var remote = new RepoFile {TimeStamp = new DateTime(2000, 12, 31, 12, 13, 14, 789)};
            sut.DetectUpdateConflct(local, current, remote, _ => result = _, null);

            Equalidator.AreEqual(remote, result);
        }