Пример #1
0
        public App()
        {
            var container = new AutofacContainer();

            container.BindToConstant(typeof(IServerService), new ServerService("http://alexv.changeip.net/"));
            container.Bind <IDialogService, DialogService>(DependencyLifecycle.SingleInstance);
            new Bootstrapper <LoginViewModel>(this, container);
        }
Пример #2
0
        public void TestInitialized()
        {
            var presenters = new List <IDynamicViewModelPresenter>();

            RepositoryMock         = new Mock <IRepository>();
            MessagePresenterMock   = new Mock <IMessagePresenter>();
            WrapperManagerMock     = new Mock <IWrapperManager>();
            ViewModelPresenterMock = new Mock <IViewModelPresenter>();
            ToastPresenterMock     = new Mock <IToastPresenter>();
            ViewModelPresenterMock.Setup(presenter => presenter.DynamicPresenters)
            .Returns(() => presenters);
            Serializer = new Serializer(AppDomain.CurrentDomain.GetAssemblies());
            var container = new AutofacContainer();

            container.BindToConstant(RepositoryMock.Object);
            container.BindToConstant(MessagePresenterMock.Object);
            container.BindToConstant(WrapperManagerMock.Object);
            container.BindToConstant(ViewModelPresenterMock.Object);
            container.BindToConstant(ToastPresenterMock.Object);
            Initialize(container, new DefaultUnitTestModule(), new PortableModule());
            ApplicationSettings.CommandExecutionMode = CommandExecutionMode.None;
            OnTestInitialized();
        }