public void Find_NoSatisfyingItems_NullReturned() { Location location; using (Scope(true)) { LocationRepository repository = new LocationRepository(SessionFactory); location = repository.Find(new UnLocode("PLKRK")); } Assert.IsNull(location); }
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")); } }
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); }