Пример #1
0
 public void TestInitialize()
 {
     factories = Substitute.For<Factories>();
     providerFactory = Substitute.For<CloudProviderFactory>();
     provider = Substitute.For<CloudProvider>();
     providerFactory.Create().Returns(provider);
     exportAndImport = Substitute.For<ExportAndImport>();
     settings = new Settings { CloudToken = "foo" };
     factories.Settings.Returns(settings);
     sut = new CloudImpl(providerFactory, factories, exportAndImport);
 }
 public void TestInitialize()
 {
     factories = Substitute.For<Factories>();
     cloudProviderFactory = Substitute.For<CloudProviderFactory>();
     cloudProvider = Substitute.For<CloudProvider>();
     cloudProviderFactory.Create().Returns(cloudProvider);
     settings = new Settings();
     factories.Settings.Returns(settings);
     vibration = Substitute.For<Vibration>();
     cloud = Substitute.For<Cloud>();
     messageDialog = Substitute.For<MessageDialog>();
     cloudMessages = new Fixture().Create<CloudMessages>();
     workerFactory = new BackgroundWorkerSyncFactory();
     sut = new ExportAndImportViewModel(factories, cloudProviderFactory, vibration, cloud, messageDialog,
         cloudMessages, workerFactory);
     cloudProvider.GetAcquiredToken().Returns(new CloudToken { Secret = "foo", Token = "bar" });
     cloudProvider.GetTokenAcquiringUrl(ExportAndImportViewModel.TOKEN_ACQUIRING_CALLBACK_URL).Returns("go");
     cloud.ListImports().Returns(new List<string>());
     navigatedTo = string.Empty;
     sut.NavigateInBrowser += (_, url) => { navigatedTo = url; };
 }