public void Setup() { _primaryCalled = new Future <Customer>(); _secondaryCalled = new Future <Customer>(); _customer = new Customer { Preferred = true }; _actionNode = new ActionNode <Customer>(x => _primaryCalled.Complete(x.Element.Object)); _constantNode = new ConstantNode <Customer>(); var element = MockRepository.GenerateMock <SessionElement <Customer> >(); element.Stub(x => x.Object).Return(_customer); _session = new StatefulSessionImpl(MockRepository.GenerateMock <RulesEngine>()); _context = new SessionRuleContext <Customer>(_session, element); }
public void Setup() { _primaryCalled = new Future<Customer>(); _secondaryCalled = new Future<Customer>(); _customer = new Customer {Preferred = true}; _actionNode = new ActionNode<Customer>(x => _primaryCalled.Complete(x.Element.Object)); _constantNode = new ConstantNode<Customer>(); var element = MockRepository.GenerateMock<SessionElement<Customer>>(); element.Stub(x => x.Object).Return(_customer); _session = new StatefulSessionImpl(MockRepository.GenerateMock<RulesEngine>()); _context = new SessionRuleContext<Customer>(_session, element); }