Ejemplo n.º 1
0
        protected override void AdditionalSetup()
        {
            // Setup MVVMCross for testing
            _mockDispatcher = new MockDispatcher();
            Ioc.RegisterSingleton <IMvxViewDispatcher>(_mockDispatcher);
            Ioc.RegisterSingleton <IMvxMainThreadDispatcher>(_mockDispatcher);
            Ioc.RegisterSingleton <IMvxStringToTypeParser>(new MvxStringToTypeParser());

            // Register our own services
            Ioc.RegisterSingleton <ICalculatorService>(() => new CalculatorService());
        }
Ejemplo n.º 2
0
        protected override void AdditionalSetup()
        {
            // Setup MVVMCross for testing
            _mockDispatcher = new MockDispatcher();
            Ioc.RegisterSingleton <IMvxViewDispatcher>(_mockDispatcher);
            Ioc.RegisterSingleton <IMvxMainThreadDispatcher>(_mockDispatcher);
            Ioc.RegisterSingleton <IMvxStringToTypeParser>(new MvxStringToTypeParser());

            //// Register our own services

            Ioc.RegisterSingleton <ICalculatorService>(() => new CalculatorService());
            Ioc.RegisterSingleton <IDreamsFetcherService>(() => new DreamsFetcherServiceMock(Mock.Of <IDreamsLogService>()));

            // var reachabilityService = new Mock<IReachabilityService>();
            // reachabilityService.Setup(x => x.IsNetworkAvailable).Returns(true);
            // reachabilityService.Setup(x => x.IsInternetAvailable).Returns(true);
            // reachabilityService.Setup(x => x.CanReachIPaperCMSServer).Returns(true);
            // reachabilityService.Setup(x => x.CanReachServicesServer).Returns(true);
            // reachabilityService.Setup(x => x.CanReachHost(It.IsAny<string>())).ReturnsAsync(true);
            // Ioc.RegisterSingleton(reachabilityService.Object);
        }