Statistics
| Branch: | Revision:

root / trunk / Pithos.Core.Test / SnapshotDifferencerTest.cs @ b666b39a

History | View | Annotate | Download (24.6 kB)

1
// -----------------------------------------------------------------------
2
// <copyright file="TestDifferencer.cs" company="Microsoft">
3
// TODO: Update copyright text.
4
// </copyright>
5
// -----------------------------------------------------------------------
6

    
7
using System.Collections;
8
using NUnit.Framework;
9
using Pithos.Interfaces;
10
using Pithos.Network;
11

    
12
namespace Pithos.Core.Test
13
{
14
    using System;
15
    using System.Collections.Generic;
16
    using System.Linq;
17
    using System.Text;
18
    using Pithos.Core.Agents;
19
    
20
    [TestFixture]
21
    public class SnapshotDifferencerTest
22
    {
23
        private ObjectInfo[] _previous;
24
        private ObjectInfo[] _current;
25
        IEqualityComparer<ObjectInfo> _comparer = new ObjectInfoComparer();
26

    
27
        [SetUp]
28
        public void Setup()
29
        {
30
            _previous = new []{
31
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="1"},
32
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="2"},
33
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="3"},
34
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="4"},
35
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name1",Bytes=123,Hash="aa4",Version=1,UUID="5"},
36
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="6"},
37
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="7"},
38
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="8"},
39
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="9"},
40
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="10"},
41
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="11"},
42
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="12"},
43
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="13"},
44
                            };
45
            _current = new []{
46
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="2"},
47
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="3"},
48
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name4",Bytes=1234,Hash="aa45",Version=1,UUID="4"},
49
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name5",Bytes=123,Hash="aa5",Version=1,UUID="14"},
50
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name1",Bytes=123,Hash="aa4",Version=1,UUID="5"},
51
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="6"},
52
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="7"},
53
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="9"},
54
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="10"},
55
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name4",Bytes=1234,Hash="aa45",Version=1,UUID="11"},
56
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name5",Bytes=123,Hash="aa5",Version=1,UUID="15"},
57
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="12"},
58
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="13"},
59
                           };
60
            
61
        }
62

    
63
        [Test]
64
        public void when_adding_a_snapshot_for_the_first_time()
65
        {
66
            var d1 = new SnapshotDifferencer();            
67
            var differencer=d1.Post(_previous);
68
            Assert.That(differencer.Deleted,Is.Empty);
69
            Assert.That(differencer.Created,Is.EquivalentTo(_previous));
70
            Assert.That(differencer.Changed,Is.Empty);
71
            Assert.That(differencer.Moved, Is.Empty, "should have no moves");
72
            Assert.That(differencer.Unchanged,Is.Empty);
73
        }
74

    
75
        [Test]
76
        public void when_adding_a_second_snapshot_with_a_deletion()
77
        {
78
            var d1 = new SnapshotDifferencer();            
79
            var differencer=d1.Post(_previous).Post(_current);
80
            var deleted=new[]
81
                            {
82
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="1"},
83
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="8"},
84
                            };
85
            Assert.That(differencer.Deleted.ToList(),Is.EquivalentTo(deleted)
86
                .Using((IEqualityComparer) new ObjectInfoComparer()));
87
        }
88
        [Test]
89
        public void when_adding_a_second_snapshot_with_an_addition()
90
        {
91
            var d1 = new SnapshotDifferencer();            
92
            var differencer=d1.Post(_previous).Post(_current);
93
            var created = new[]
94
                              {
95
                                  new ObjectInfo { Account = "acc1", Container = "Cont1", Name = "Name5", Bytes = 123, Hash = "aa5", Version = 1,UUID="14" },
96
                                  new ObjectInfo { Account = "acc1", Container = "Cont2", Name = "Name5", Bytes = 123, Hash = "aa5", Version = 1,UUID="15" },
97
                              };
98
            Assert.That(differencer.Created.ToList(), Is.EquivalentTo(created)
99
                .Using((IEqualityComparer)new ObjectInfoComparer()));
100
        }
101
        [Test]
102
        public void when_adding_a_second_snapshot_with_a_change()
103
        {
104
            var d1 = new SnapshotDifferencer();            
105
            var differencer=d1.Post(_previous).Post(_current);
106
            var changed = new[] { 
107
                new ObjectInfo { Account = "acc1", Container = "Cont1", Name = "Name4", Bytes = 1234, Hash = "aa45", PreviousHash="aa4", Version = 1,UUID="4" },
108
                new ObjectInfo { Account = "acc1", Container = "Cont2", Name = "Name4", Bytes = 1234, Hash = "aa45", PreviousHash="aa4", Version = 1,UUID="11" },
109
            };
110

    
111
            Comparison<ObjectInfo> comparer = (x, y) =>
112
                                                  {
113
                                                      if (x.Account == y.Account
114
                                                          && x.Container == y.Container
115
                                                          && x.Name == y.Name
116
                                                          && x.Hash == y.Hash
117
                                                          && x.PreviousHash == y.PreviousHash)
118
                                                          return 0;
119
                                                      return 1;
120
                                                  };
121

    
122
            Assert.That(differencer.Changed.ToList(), Is.EquivalentTo(changed).Using(comparer));
123
        }
124

    
125
        [Test]
126
        public void when_adding_a_second_snapshot_with_a_rename()
127
        {
128
            var d1 = new SnapshotDifferencer();
129
            var current = new[]{
130
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="1"},
131
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="2"},
132
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name3a",Bytes=123,Hash="aa3",Version=1,UUID="3"},
133
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="4"},
134
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name1",Bytes=123,Hash="aa4",Version=1,UUID="5"},
135
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="6"},
136
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="7"},
137
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="8"},
138
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="9"},
139
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="10"},
140
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="11"},
141
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="12"},
142
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="13"},
143
                            };
144

    
145
            var differencer=d1.Post(_previous).Post(current);
146
            var moved = new[] { 
147
                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name3a",Bytes=123,Hash="aa3",PreviousHash="aa3",Version=1,UUID="3"}
148
            };
149

    
150
            Comparison<ObjectInfo> comparer = (x, y) =>
151
                                                  {
152
                                                      if (x.Account == y.Account
153
                                                          && x.Container == y.Container
154
                                                          && x.Name == y.Name
155
                                                          && x.Hash == y.Hash
156
                                                          && x.PreviousHash == y.PreviousHash)
157
                                                          return 0;
158
                                                      return 1;
159
                                                  };
160
            Assert.That(differencer.Moved.ToList(), Is.EquivalentTo(moved).Using(comparer));
161
            Assert.That(differencer.Deleted, Is.Empty);
162
            Assert.That(differencer.Created, Is.Empty);
163
            Assert.That(differencer.Changed, Is.Empty);
164
            //Assert.That(differencer.Unchanged, Is.Empty);
165
            Assert.That(differencer.Moved.ToList(), Is.EquivalentTo(moved).Using(comparer));
166
        }
167

    
168
        [Test]
169
        public void when_adding_a_second_snapshot_with_a_changed_rename()
170
        {
171
            var d1 = new SnapshotDifferencer();
172
            var current = new[]{
173
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="1"},
174
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="2"},
175
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name3a",Bytes=123,Hash="aa35",Version=1,UUID="3"},
176
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="4"},
177
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name1",Bytes=123,Hash="aa4",Version=1,UUID="5"},
178
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="6"},
179
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="7"},
180
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="8"},
181
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="9"},
182
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="10"},
183
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="11"},
184
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="12"},
185
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="13"},
186
                            };
187

    
188
            var differencer = d1.Post(_previous).Post(current);
189
            var moved = new[] { 
190
                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name3a",Bytes=123,Hash="aa35",PreviousHash="aa3",Version=1,UUID="3"}
191
            };
192

    
193
            Comparison<ObjectInfo> comparer = (x, y) =>
194
            {
195
                if (x.Account == y.Account
196
                    && x.Container == y.Container
197
                    && x.Name == y.Name
198
                    && x.Hash == y.Hash
199
                    && x.PreviousHash == y.PreviousHash)
200
                    return 0;
201
                return 1;
202
            };
203
            Assert.That(differencer.Moved.ToList(), Is.EquivalentTo(moved).Using(comparer));
204
            Assert.That(differencer.Deleted, Is.Empty);
205
            Assert.That(differencer.Created, Is.Empty);
206
            Assert.That(differencer.Changed, Is.Empty);
207
            //Assert.That(differencer.Unchanged, Is.Empty);
208
            Assert.That(differencer.Moved.ToList(), Is.EquivalentTo(moved).Using(comparer));
209
        }
210

    
211
        [Test]
212
        public void when_adding_a_second_snapshot_with_a_move()
213
        {
214
            var d1 = new SnapshotDifferencer();
215
            var current = new[]{
216
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="1"},
217
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="2"},
218
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name3",Bytes=123,Hash="aa3",Version=1,UUID="3"},
219
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="4"},
220
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name1",Bytes=123,Hash="aa4",Version=1,UUID="5"},
221
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="6"},
222
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="7"},
223
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="8"},
224
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="9"},
225
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="10"},
226
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="11"},
227
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="12"},
228
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="13"},
229
                            };
230

    
231
            var differencer=d1.Post(_previous).Post(current);
232
            var moved = new[] { 
233
                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name3",Bytes=123,Hash="aa3",PreviousHash="aa3",Version=1},
234
            };
235

    
236
            Comparison<ObjectInfo> comparer = (x, y) =>
237
                                                  {
238
                                                      if (x.Account == y.Account
239
                                                          && x.Container == y.Container
240
                                                          && x.Name == y.Name
241
                                                          && x.Hash == y.Hash
242
                                                          && x.PreviousHash == y.PreviousHash)
243
                                                          return 0;
244
                                                      return 1;
245
                                                  };
246

    
247
            Assert.That(differencer.Deleted, Is.Empty);
248
            Assert.That(differencer.Created, Is.Empty);
249
            Assert.That(differencer.Changed, Is.Empty);
250
            //Assert.That(differencer.Unchanged, Is.Empty);
251
            Assert.That(differencer.Moved.ToList(), Is.EquivalentTo(moved).Using(comparer));
252
        }
253

    
254
        [Test]
255
        public void when_adding_a_second_snapshot_with_unchanged()
256
        {
257
            var d1 = new SnapshotDifferencer();            
258
            var differencer=d1.Post(_previous).Post(_current);
259
            var unchanged = new[]
260
                                {
261
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="2"},
262
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="3"},
263
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="6"},
264
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="7"},  
265
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name1",Bytes=123,Hash="aa4",Version=1,UUID="5"},  
266
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="9"},
267
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="10"},
268
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="12"},
269
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="13"},                                    
270
                                };            
271
            Assert.That(differencer.Unchanged.ToList(), Is.EquivalentTo(unchanged)
272
                .Using((IEqualityComparer)new ObjectInfoComparer()));
273
        }
274

    
275
        [Test]
276
        public void when_adding_a_null_first_snapshot()
277
        {
278
            var d1 = new SnapshotDifferencer();            
279
            var differencer=d1.Post(null);
280
            Assert.That(differencer.Deleted, Is.Empty);
281
            Assert.That(differencer.Created, Is.Empty);
282
            Assert.That(differencer.Changed, Is.Empty);
283
            Assert.That(differencer.Moved, Is.Empty, "should have no moves");
284
            Assert.That(differencer.Unchanged, Is.Empty);
285
        }
286

    
287
        [Test]
288
        public void when_adding_a_null_second_snapshot()
289
        {
290
            var d1 = new SnapshotDifferencer();            
291
            var differencer=d1.Post(_previous).Post(null);
292
            Assert.That(differencer.Deleted, Is.EquivalentTo(_previous));
293
            Assert.That(differencer.Created, Is.Empty);
294
            Assert.That(differencer.Changed, Is.Empty);
295
            Assert.That(differencer.Moved, Is.Empty, "should have no moves");
296
            Assert.That(differencer.Unchanged, Is.Empty);
297
        }
298

    
299
        [Test]
300
        public void when_adding_no_modifications()
301
        {
302
            var d1 = new SnapshotDifferencer();
303
            //NOTE: Must post nomods for all accounts and contaienrs, otherwise the missing
304
            //containers will appear deleted
305
            var noModItem = new[]{
306
                                    new NoModificationInfo("acc1", "Cont1"),
307
                                    new NoModificationInfo("acc1", "Cont2"),
308
                                    new NoModificationInfo("acc2", "Cont1"),
309
                                    new NoModificationInfo("acc2", "Cont2"),
310
                                };
311
            var differencer = d1.Post(_previous)
312
                .Post(noModItem);
313
            Assert.That(differencer.Deleted, Is.Empty,"should have no deletions");
314
            Assert.That(differencer.Created, Is.Empty,"should have no insertions");
315
            Assert.That(differencer.Changed, Is.Empty,"should have no changes");
316
            Assert.That(differencer.Moved, Is.Empty, "should have no moves");
317
            Assert.That(differencer.Unchanged, Is.EquivalentTo(_previous),"should be equivalent to previous");
318
            
319
        }
320

    
321
        [Test]
322
        public void when_adding_no_mod_for_a_folder()
323
        {
324
            var d1 = new SnapshotDifferencer();
325
            //NOTE: Must post nomods for all accounts and contaienrs, otherwise the missing
326
            //containers will appear deleted
327
            var noModItems = new[]{
328
                                    new NoModificationInfo("acc1", "Cont1","Folder1"),
329
                                    new NoModificationInfo("acc1", "Cont2"),
330
                                    new NoModificationInfo("acc2", "Cont1"),
331
                                    new NoModificationInfo("acc2", "Cont2"),
332
                                };
333
            var deleted = new[]
334
                            {
335
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="1"},
336
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="2"},
337
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="3"},
338
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="4"},
339
                            };
340
            var unchanged = new[]{
341
                                new ObjectInfo{Account="acc1",Container="Cont1",Name="Folder1/Name1",Bytes=123,Hash="aa4",Version=1,UUID="1"},
342
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="6"},
343
                                new ObjectInfo{Account="acc2",Container="Cont1",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="7"},
344
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="8"},
345
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="9"},
346
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name3",Bytes=123,Hash="aa3",Version=1,UUID="10"},
347
                                new ObjectInfo{Account="acc1",Container="Cont2",Name="Name4",Bytes=123,Hash="aa4",Version=1,UUID="11"},
348
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name1",Bytes=123,Hash="aa1",Version=1,UUID="12"},
349
                                new ObjectInfo{Account="acc2",Container="Cont2",Name="Name2",Bytes=123,Hash="aa2",Version=1,UUID="13"},
350
                            };
351
            var differencer = d1.Post(_previous)
352
                .Post(noModItems);
353

    
354
            
355
            Assert.That(differencer.Deleted.ToList(), Is.EquivalentTo(deleted).Using(_comparer), "should have deletions only from acc1/cont1");
356
            Assert.That(differencer.Created, Is.Empty,"should have no insertions");
357
            Assert.That(differencer.Changed, Is.Empty,"should have no changes");
358
            Assert.That(differencer.Moved, Is.Empty, "should have no moves");
359
            Assert.That(differencer.Unchanged, Is.EquivalentTo(unchanged).Using(_comparer),"should be equivalent to previous except the direct leafs of acc1/cont1");
360
            
361
        }
362

    
363
    }
364

    
365
    
366
}