public void OnResourceExecutedWithoutExecuting() { ResourceExecutedContext context = new ResourceExecutedContext( m_actionContext, Substitute.For <IList <IFilterMetadata> >()); var filter = new ResourceLockFilterAttribute(m_mgr, m_logger, m_config); filter.OnResourceExecuted(context); m_lock.Received(0).Release(); } /* End of Function - OnResourceExecutedWithoutExecuting */
public void OnResourceExecuting() { ResourceExecutingContext context = new ResourceExecutingContext( m_actionContext, Substitute.For <IList <IFilterMetadata> >(), Substitute.For <IList <IValueProviderFactory> >()); var filter = new ResourceLockFilterAttribute(m_mgr, m_logger, m_config); filter.OnResourceExecuting(context); m_mgr.Received(1).BlockFor("test_owner_repo", m_timeout); } /* End of Function - OnResourceExecuting */
public void OnResourceExecutedAfterExecuting() { var filters = Substitute.For <IList <IFilterMetadata> >(); ResourceExecutingContext exingContext = new ResourceExecutingContext( m_actionContext, filters, Substitute.For <IList <IValueProviderFactory> >()); ResourceExecutedContext exedContext = new ResourceExecutedContext( m_actionContext, filters); var filter = new ResourceLockFilterAttribute(m_mgr, m_logger, m_config); filter.OnResourceExecuting(exingContext); filter.OnResourceExecuted(exedContext); m_lock.Received(1).Release(); } /* End of Function - OnResourceExecutedAfterExecuting */
public void ThrowsOnNullLogger() { var filter = new ResourceLockFilterAttribute(m_mgr, null, m_config); } /* End of Function - ThrowsOnNullLogger */
public void ThrowsOnNullConfig() { var filter = new ResourceLockFilterAttribute(m_mgr, m_logger, null); } /* End of Function - ThrowsOnNullConfig */