Exemplo n.º 1
0
        public void SetUp()
        {
            ServiceProvider.DesignTimeManager     = DesignTimeManagerImpl.Instance;
            ServiceProvider.AttachedValueProvider = new AttachedValueProvider();
            CanBeResolvedTypes = new List <Type>
            {
                typeof(IThreadManager),
                typeof(IViewModelSettings),
                typeof(IViewManager),
                typeof(IDisplayNameProvider),
                typeof(IViewModelProvider),
                typeof(IVisualStateManager),
                typeof(OperationCallbackManagerMock)
            };
            OperationCallbackManager = new OperationCallbackManagerMock();
            ViewManager   = new ViewManagerMock();
            ThreadManager = new ThreadManagerMock();
            ServiceProvider.ThreadManager = ThreadManager;
            Settings            = new ViewModelSettingsMock();
            DisplayNameProvider = new DisplayNameProviderMock();
            IocContainer        = new IocContainerMock
            {
                GetFunc            = GetFunc,
                CanResolveDelegate = CanResolve
            };
            Tracer.TraceInformation = true;
            ServiceProvider.Tracer  = new ConsoleTracer();
            ViewModelProvider       = new ViewModelProvider(IocContainer);
            OnInit();
            var app = new UnitTestApp(this);

            app.Initialize(PlatformInfo.UnitTest, IocContainer, Empty.Array <Assembly>(), DataContext.Empty);
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            ServiceProvider.AttachedValueProvider    = new AttachedValueProvider();
            ServiceProvider.ViewModelSettingsFactory = model => new DefaultViewModelSettings();
            ServiceProvider.ReflectionManager        = new ExpressionReflectionManager();
            CanBeResolvedTypes = new List <Type>
            {
                typeof(IThreadManager),
                typeof(IViewManager),
                typeof(IDisplayNameProvider),
                typeof(IViewModelProvider),
                typeof(OperationCallbackManagerMock),
                typeof(INavigationDispatcher),
                typeof(IViewModelPresenter)
            };
            OperationCallbackManager = new OperationCallbackManagerMock();
            NavigationDispatcher     = new NavigationDispatcherMock();
            ViewManager                   = new ViewManagerMock();
            ThreadManager                 = new ThreadManagerMock();
            ViewModelPresenter            = new ViewModelPresenterMock();
            ServiceProvider.ThreadManager = ThreadManager;
            DisplayNameProvider           = new DisplayNameProviderMock();
            IocContainer                  = new IocContainerMock
            {
                GetFunc            = GetFunc,
                CanResolveDelegate = CanResolve
            };
            Tracer.TraceInformation = true;
            ServiceProvider.Tracer  = new ConsoleTracer();
            ViewModelProvider       = new ViewModelProvider(IocContainer);
            OnInit();
            var app = new UnitTestApp();

            app.Initialize(PlatformInfo.UnitTest, IocContainer, Empty.Array <Assembly>(), DataContext.Empty);
        }
Exemplo n.º 3
0
 public void SetUp()
 {
     ServiceProvider.DesignTimeManager     = DesignTimeManagerImpl.Instance;
     ServiceProvider.AttachedValueProvider = new AttachedValueProvider();
     CanBeResolvedTypes = new List <Type>
     {
         typeof(IThreadManager),
         typeof(IViewModelSettings),
         typeof(IViewManager),
         typeof(IDisplayNameProvider),
         typeof(IViewModelProvider),
         typeof(IVisualStateManager),
         typeof(OperationCallbackManagerMock)
     };
     OperationCallbackManager = new OperationCallbackManagerMock();
     ViewManager   = new ViewManagerMock();
     ThreadManager = new ThreadManagerMock();
     ServiceProvider.ThreadManager = ThreadManager;
     Settings = new ViewModelSettingsMock();
     ApplicationSettings.ViewModelSettings = Settings;
     DisplayNameProvider = new DisplayNameProviderMock();
     IocContainer        = new IocContainerMock
     {
         GetFunc            = GetFunc,
         CanResolveDelegate = CanResolve
     };
     ServiceProvider.Tracer = new ConsoleTracer();
     ServiceProvider.Initialize(IocContainer, PlatformInfo.UnitTest);
     ViewModelProvider = new ViewModelProvider(IocContainer);
     OnInit();
 }