public virtual void Initialize() { DataService = new DummySqLiteDataService(); DataService.RegisterRepositoryProvider( new Func <IUnitOfWork, IDummyRepository>(work => new DummyRepository(work))); UnitOfWork = DataService.BeginUnitOfWork(); Repository = UnitOfWork.GetRepository <IDummyRepository>(); }
public virtual void Initialize() { if (DataService != null) { DataService.Dispose(); DataService = null; } if (UnitOfWork != null) { UnitOfWork.Dispose(); UnitOfWork = null; } DataService = new DummyLiteDbDataService(); DataService.RegisterRepositoryProvider( new Func <IUnitOfWork, IDummyRepository>(work => new DummyRepository(work))); UnitOfWork = DataService.BeginUnitOfWork(); Repository = UnitOfWork.GetRepository <IDummyRepository>(); }
public DummyService(IDummyRepository dummyRepository) { _dummyRepository = dummyRepository; }
/// <summary> /// Dummy constructor /// </summary> /// <param name="dummy_repository">Dependency from dummy repo</param> public DummyService(IDummyRepository dummy_repository) { this.dummy_repository = dummy_repository; }
public virtual void Cleanup() { Repository = null; UnitOfWork?.Dispose(); DataService?.Dispose(); }
public void SetUp() { _stubDummyRepository = MockRepository.GenerateStub<IDummyRepository>(); _dummyBrowserViewModel = new DummyBrowserViewModel(_stubDummyRepository); }
public void SetUp() { _stubDummyRepository = MockRepository.GenerateStub<IDummyRepository>(); _stubMessageBoxService = MockRepository.GenerateStub<IMessageBoxService>(); _containerFacade = MockRepository.GenerateStub<IContainerFacade>(); _containerFacade.Stub(x => x.Resolve<DummyBrowserViewModel>()).Return( new DummyBrowserViewModel(_stubDummyRepository)); _containerFacade.Stub(x => x.Resolve<DummyDetailViewModel>()).Return( new DummyDetailViewModel()); //EntityBrowserViewModel = (TBrowser) Activator.CreateInstance(typeof (TBrowser), entityRepository); //EntityBrowserViewModel = ContainerFacade.Resolve<TBrowser>(); ////EntityDetailViewModel = (TDetail) Activator.CreateInstance(typeof (TDetail)); //EntityDetailViewModel = ContainerFacade.Resolve<TDetail>(); _dummyViewModel = new DummyViewModel(_stubDummyRepository, _stubMessageBoxService, _containerFacade); Assert.AreEqual(ViewMode.BrowseMode, _dummyViewModel.CurrentViewMode); }
public DummyManager(IDummyRepository dummyRepository) { _dummyRepository = dummyRepository; }