public void node_should_be_saved()
 {
     using(var spy = new NHibernateSqlLogSpy())
     {
         InNewSession(session =>
         {
             var retrieved = session.GetNode(original.Id);
             Assert.That(retrieved, Is.Not.Null);
         });
         var events = spy.Appender.GetEvents();
         foreach(var e in events)
         {
              Console.WriteLine(e.RenderedMessage);
         }
     }
 }
Пример #2
0
 public QuerySpy(int expectedNumber)
 {
     this.expectedNumber = expectedNumber;
     spy = new NHibernateSqlLogSpy();
 }
 protected override void because()
 {
     using (var spy = new NHibernateSqlLogSpy())
     {
         InNewSession(session =>
         {
             originalNodes = "ABCDE".Select(name => new Node(name.ToString())).ToList(); // node for each char
             originalNodes[A].AddConnection(originalNodes[B], HighConnectionQuality, MediumConnectionQuality);
             originalNodes[B].AddConnection(originalNodes[C], HighConnectionQuality, MediumConnectionQuality);
             originalNodes[C].AddConnection(originalNodes[D], HighConnectionQuality, MediumConnectionQuality);
             originalNodes[D].AddConnection(originalNodes[E], HighConnectionQuality, MediumConnectionQuality);
             session.SaveOrUpdate(originalNodes[0]);
         });
         var events = spy.Appender.GetEvents();
         foreach (var e in events)
         {
             Console.WriteLine(e.RenderedMessage);
         }
     }
 }