Implementation
http://code.google.com/p/unhaddins/source/browse/trunk/uNhAddIns/uNhAddIns.TestUtils/Logging/Spying.cs
Example
Spying.Logger<LoggedClassStub>()
.Execute(() => (new LoggedClassStub()).LogDebug("my message"));
Spying.Logger<NhConversation>().Execute(() =>
c.Bind(s)).WholeMessage.Should().Contain("Already
session bound on call to Bind()");
2009/6/1 dnagir <[email protected]>
>
> Hi,
>
> I want to play with NH a bit in my tests to ensure I get the expected
> SQL statements.
> So I want to write code like this:
>
>
> public void SomeTest() {
> // Something here...
> using (var sqlTracker = new TrackSql(session)) {
> var person = session.Get<Person>(12345);
> Assert.AreEqual(1, sqlTracker.TotalQueries);
> }
> // Something there...
> }
>
>
> The code above is just simple case but the general aim is to check
> what queries have been executed.
> Can you suggest me a starting point for the TrackSql class? What
> interfaces should I implement (IInterseptor doesn't look like the
> correct one)...
>
> Thanks,
> Dmitriy.
> >
>
--
Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---