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

            RequestListenersShouldBeCreatedOnEnumeration(sut, instanceTracker);
        }
Esempio n. 2
0
 public void SetUp()
 {
     _instanceTracker = new InstanceTracker();
 }
Esempio n. 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");
        }
Esempio n. 4
0
 public TestRequestListener(InstanceTracker tracker) : base(tracker)
 {
 }