예제 #1
0
 public void can_move_Section()
 {
     sut = Builder.newPlaylist("p1");
     sut.getSectionAt(1).Name = "s1";
     sut.append(new Section { Name = "s2" });
     using(var s = sf.OpenSession())
     using(var t = s.BeginTransaction()) {
         s.Save(sut);
         t.Commit();
     }
     using(var s = sf.OpenSession())
     using(var t = s.BeginTransaction()) {
         var p = s.Load<Playlist>(sut.Id);
         p.moveSection(1, 2);
         t.Commit();
     }
     using(var s = sf.OpenSession()) {
         var playlists = s.Query<Playlist>().ToList();
         Assert.AreEqual(1, playlists.Count);
         Assert.AreEqual("s2", playlists.Single().getSectionAt(1).Name);
         Assert.AreEqual("s1", playlists.Single().getSectionAt(2).Name);
     }
 }