public void CheckSingleQueryEventHandlerThrowExceptionFlagFalse() { // Arrange var eventHandler = new TestRepositoryQueriedEvent(); var repository = new FamilyQueryRepository(new QueryEventHandler(eventHandler)); // Act var entity = repository.GetEntity <Person>(p => p.Id == Names.AimmeOsborne, false); var queryEvent = (SimpleRepositoryQueryEvent)eventHandler.QueriedEventList.Single(); // Assert Assert.IsNotNull(entity); Assert.IsFalse(queryEvent.ThrowExceptionIfZeroOrManyFound.Value); }
//[Test] public void CheckSimpleEntitiesQueryEventHandler() { // Arrange var eventHandler = new TestRepositoryQueriedEvent(); var repository = new FamilyQueryRepository(new QueryEventHandler(eventHandler)); // Act repository.GetEntities <Person>(); var queryEvent = (SimpleRepositoryQueryEvent)eventHandler.QueriedEventList.Single(); // Assert Assert.IsInstanceOf <DefaultQueryStrategy>(queryEvent.QueryStrategy); Assert.IsTrue(queryEvent.QueryStrategy == null); Assert.IsNull(queryEvent.ThrowExceptionIfZeroOrManyFound); }