コード例 #1
0
 public void Find_NoSatisfyingItems_NullReturned()
 {         
    Location location;
    using (Scope(true))
    {
       LocationRepository repository = new LocationRepository(SessionFactory);
       location = repository.Find(new UnLocode("PLKRK"));
    }
    Assert.IsNull(location);
 }
コード例 #2
0
 public void Find_ManySatisfyingItems_ExceptionThrown()
 {
    using (Scope(true))
    {
       Session.Save(new Location(new UnLocode("PLKRK"), "Krakow"));
       Session.Save(new Location(new UnLocode("PLKRK"), "Krakow2"));
    }         
    using (Scope(true))
    {
       LocationRepository repository = new LocationRepository(SessionFactory);
       repository.Find(new UnLocode("PLKRK"));
    }         
 }
コード例 #3
0
 public void Find_OneSatisfyingItem_ResultReturned()
 {
    using (Scope(true))
    {
       Session.Save(new Location(new UnLocode("PLKRK"), "Krakow"));
    }
    Location location;
    using (Scope( true))
    {
       LocationRepository repository = new LocationRepository(SessionFactory);
       location = repository.Find(new UnLocode("PLKRK"));
    }
    Assert.IsNotNull(location);
 }