예제 #1
0
        public void UseRequestListener()
        {
            var instanceTracker = new InstanceTracker();
            var sut             = Configure(c => c.UseRequestListener(sp => new TestRequestListener(instanceTracker)));

            RequestListenersShouldBeCreatedOnEnumeration(sut, instanceTracker);
        }
예제 #2
0
 public void SetUp()
 {
     _instanceTracker = new InstanceTracker();
 }
예제 #3
0
        private static void RequestListenersShouldBeCreatedOnEnumeration(ISlackServiceProvider sut, InstanceTracker instanceTracker)
        {
            var listeners = sut.GetRequestListeners();

            instanceTracker.GetInstances <TestRequestListener>().ShouldBeEmpty("Listeners should not be created until enumerated");

            var expectedListeners = new[] { listeners.Last(), listeners.Last() };
            var createdInstances  = instanceTracker.GetInstances <TestRequestListener>().Cast <ISlackRequestListener>();

            createdInstances.ShouldMatchReferences(expectedListeners, "Listeners should be created once per enumeration");
        }
예제 #4
0
 public TestRequestListener(InstanceTracker tracker) : base(tracker)
 {
 }