Exemplo n.º 1
0
        public void set_GetKey()
        {
            ICallback callback = MockRepository.GenerateStub <ICallback>();

            cache.GetKey = callback.GetKeyCallback;
            cache.GetKey(42);
            callback.AssertWasCalled(c => c.GetKeyCallback(42));
        }
Exemplo n.º 2
0
        public void ifPropertyTypeIs_invokes_method()
        {
            Accessor accessor = _expression.ToAccessor();

            accessor.IfPropertyTypeIs <int>(_callback.Callback);
            _callback.AssertWasCalled(c => c.Callback());
            accessor.IfPropertyTypeIs <PropertyHolder>(_uncalledCallback.Callback);
            _uncalledCallback.AssertWasNotCalled(c => c.Callback());
        }
Exemplo n.º 3
0
        public void set_OnAddition()
        {
            ICallback callback = MockRepository.GenerateStub <ICallback>();

            cache["firstKey"] = 0;
            callback.AssertWasNotCalled(c => c.OnAdditionCallback(42));
            cache.OnAddition = callback.OnAdditionCallback;
            cache[Key]       = 42;
            callback.AssertWasCalled(c => c.OnAdditionCallback(42));
        }