コード例 #1
0
 public virtual void Initialize()
 {
     DataService = new DummySqLiteDataService();
     DataService.RegisterRepositoryProvider(
         new Func <IUnitOfWork, IDummyRepository>(work => new DummyRepository(work)));
     UnitOfWork = DataService.BeginUnitOfWork();
     Repository = UnitOfWork.GetRepository <IDummyRepository>();
 }
コード例 #2
0
        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>();
        }
コード例 #3
0
 public DummyService(IDummyRepository dummyRepository)
 {
     _dummyRepository = dummyRepository;
 }
コード例 #4
0
 /// <summary>
 /// Dummy constructor
 /// </summary>
 /// <param name="dummy_repository">Dependency from dummy repo</param>
 public DummyService(IDummyRepository dummy_repository)
 {
     this.dummy_repository = dummy_repository;
 }
コード例 #5
0
 public virtual void Cleanup()
 {
     Repository = null;
     UnitOfWork?.Dispose();
     DataService?.Dispose();
 }
コード例 #6
0
 public void SetUp()
 {
     _stubDummyRepository = MockRepository.GenerateStub<IDummyRepository>();
     _dummyBrowserViewModel = new DummyBrowserViewModel(_stubDummyRepository);
 }
コード例 #7
0
        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);
        }
コード例 #8
0
 public DummyManager(IDummyRepository dummyRepository)
 {
     _dummyRepository = dummyRepository;
 }