Exemplo n.º 1
0
        public void SetupForTest()
        {
            mockContainer      = MockRepository.GenerateMock <IServiceProviderBindingContainer>();
            dataStorageService = MockRepository.GenerateMock <IDataStorageService>();
            controlService     = MockRepository.GenerateMock <IControlService>();
            viewModel          = new SimpleViewModel();

            //object under test
            binder = new ViewStateBinder(mockContainer, dataStorageService, controlService);

            mockContainer.Expect(mc => mc.IsPostBack).IgnoreArguments().Return(true);
            mockContainer.Expect(mc => mc.DataContext).IgnoreArguments().Return(viewModel);
        }
Exemplo n.º 2
0
        public void SetupForTest()
        {
            mockContainer      = MockRepository.GenerateMock <IServiceProviderBindingContainer>();
            dataStorageService = MockRepository.GenerateMock <IDataStorageService>();
            controlService     = MockRepository.GenerateMock <IControlService>();
            viewModel          = MockRepository.GenerateMock <ISimpleViewModel>();
            mockContainer.Expect(c => c.DataContext).IgnoreArguments().Return(viewModel);

            //object under test
            binder = new ViewStateBinder(mockContainer, dataStorageService, controlService);

            //setup mock services
            collection = new Binding.BindingCollection();
            dataStorageService.Expect(ds => ds.RetrieveOrCreate <Binding.BindingCollection>(null)).IgnoreArguments().Return(collection);

            //dataStorageService.Expect(ds => ds.Retrieve<object>(null)).IgnoreArguments()Return(viewModel);
        }