public MockMagpie(string validUrl, IDebuggingInfoLogger infoLogger = null, IAnalyticsLogger analyticsLogger = null) : base(new AppInfo(validUrl), infoLogger, analyticsLogger) { _remoteContentDownloader = Substitute.For <IRemoteContentDownloader>(); _remoteContentDownloader.DownloadStringContent(validUrl, Arg.Any <IDebuggingInfoLogger>()).Returns(Task.FromResult(VALID_JSON)); RemoteContentDownloader = _remoteContentDownloader; }
public MainWindowViewModel(AppInfo appInfo, IDebuggingInfoLogger logger, IRemoteContentDownloader contentDownloader, IAnalyticsLogger analyticsLogger) { AppIconPath = appInfo.AppIconPath; _logger = logger; _contentDownloader = contentDownloader; _analyticsLogger = analyticsLogger; }
/// <summary> /// Creates the instance of Data Generator and Initializes existing test definition /// </summary> /// <param name="testManager"></param> public ABTestConversionGenerator(IABTestManager testManager, IAnalyticsLogger logger) { mTestManager = testManager ?? throw new ArgumentNullException(nameof(testManager)); mLogger = logger ?? throw new ArgumentNullException(nameof(logger)); Init(); }
public MainWindowViewModel(AppInfo appInfo, IDebuggingInfoLogger logger, IRemoteContentDownloader contentDownloader, IAnalyticsLogger analyticsLogger) { AppIconPath = appInfo.AppIconPath; _logger = logger; _contentDownloader = contentDownloader; _analyticsLogger = analyticsLogger; }
public MagpieUpdater(AppInfo appInfo, IDebuggingInfoLogger debuggingInfoLogger = null, IAnalyticsLogger analyticsLogger = null) { _appInfo = appInfo; _logger = debuggingInfoLogger ?? new DebuggingWindowViewModel(); _analyticsLogger = analyticsLogger ?? new AnalyticsLogger(); RemoteContentDownloader = new DefaultRemoteContentDownloader(); UpdateDecider = new UpdateDecider(_logger); }
public SearchController(TypedSearchItemViewModelFactory searchItemViewModelFactory, IPagesActivityLogger pagesActivityLogger, IAnalyticsLogger analyticsLogger, ISiteService siteService) { this.searchItemViewModelFactory = searchItemViewModelFactory; this.pagesActivityLogger = pagesActivityLogger; this.analyticsLogger = analyticsLogger; this.siteService = siteService; }
public MockMainWindowViewModel(AppInfo appInfo, IDebuggingInfoLogger logger, IRemoteContentDownloader contentDownloader, IAnalyticsLogger analyticsLogger) : base(appInfo, logger, contentDownloader, analyticsLogger) { DownloadNowCommand = new DelegateCommand(message => analyticsLogger.LogDownloadNow()); SkipThisVersionCommand = new DelegateCommand(message => analyticsLogger.LogUserSkipsUpdate(new Channel())); RemindMeLaterCommand = new DelegateCommand(message => analyticsLogger.LogRemindMeLater()); }
public MagpieUpdater(AppInfo appInfo, IDebuggingInfoLogger debuggingInfoLogger = null, IAnalyticsLogger analyticsLogger = null) { _appInfo = appInfo; _logger = debuggingInfoLogger ?? new DebuggingWindowViewModel(); _analyticsLogger = analyticsLogger ?? new AnalyticsLogger(); RemoteContentDownloader = new DefaultRemoteContentDownloader(); UpdateDecider = new UpdateDecider(_logger); }
public void Initialize() { var debuggingInfoLogger = Substitute.For<IDebuggingInfoLogger>(); _analyticsLogger = Substitute.For<IAnalyticsLogger>(); var remoteContentDownloader = Substitute.For<IRemoteContentDownloader>(); var appInfo = new AppInfo("valid_url"); _appCast = new MockRemoteAppcast(new Version(1, 0)); _mainWindowViewModel = new MockMainWindowViewModel(appInfo, debuggingInfoLogger, remoteContentDownloader, _analyticsLogger); }
public SearchController(TypedSearchItemViewModelFactory searchItemViewModelFactory, IPagesActivityLogger pagesActivityLogger, IAnalyticsLogger analyticsLogger, ISiteService siteService, IHttpContextRetriever retriever) { this.searchItemViewModelFactory = searchItemViewModelFactory; this.pagesActivityLogger = pagesActivityLogger; this.analyticsLogger = analyticsLogger; this.siteService = siteService; this.retriever = retriever; }
public void Initialize() { var debuggingInfoLogger = Substitute.For <IDebuggingInfoLogger>(); _analyticsLogger = Substitute.For <IAnalyticsLogger>(); var remoteContentDownloader = Substitute.For <IRemoteContentDownloader>(); var appInfo = new AppInfo("valid_url"); _appCast = new MockRemoteAppcast(new Version(1, 0)); _mainWindowViewModel = new MockMainWindowViewModel(appInfo, debuggingInfoLogger, remoteContentDownloader, _analyticsLogger); }
public void Initialize() { var debuggingInfoLogger = Substitute.For <IDebuggingInfoLogger>(); _analyticsLogger = Substitute.For <IAnalyticsLogger>(); var remoteContentDownloader = Substitute.For <IRemoteContentDownloader>(); var appInfo = new AppInfo("valid_url"); _channel = new MockChannel(1, "1.0"); AssemblyInjector.Inject(); _mainWindowViewModel = new MockMainWindowViewModel(appInfo, debuggingInfoLogger, remoteContentDownloader, _analyticsLogger); }
public ScanViewModelBase(IResolver resolver) { this.analyticsLogger = new AnalyticsFactory().CreateAnalyticsItem(resolver, this); }
public ExampleMagpie(AppInfo appInfo, IDebuggingInfoLogger debuggingInfoLogger = null, IAnalyticsLogger analyticsLogger = null) : base(appInfo, debuggingInfoLogger, analyticsLogger) { }
public MockMainWindowViewModel(AppInfo appInfo, IDebuggingInfoLogger logger, IRemoteContentDownloader contentDownloader, IAnalyticsLogger analyticsLogger) : base(appInfo, logger, contentDownloader, analyticsLogger) { DownloadNowCommand = new DelegateCommand(message=> analyticsLogger.LogDownloadNow()); SkipThisVersionCommand = new DelegateCommand(message => analyticsLogger.LogSkipThisVersion()); RemindMeLaterCommand = new DelegateCommand(message => analyticsLogger.LogRemindMeLater()); }
protected override IAnalyticsLogger CreateSpecialAnalyticsItem(IResolver resolver, IAnalyticsLogger analyticsTarget) { var analytics = resolver.GetInstanceOf <IInAppAnalytics>(); if (analyticsTarget is ScanResultWithItemsViewModel) { return(new OnboardingItemScanResultAnalyticsLogger <Events.ScanResultsEvent>(analytics, OnboardingSteps.ScanResultWithItems, (IScanSummary)analyticsTarget)); } else if (analyticsTarget is ProgressScanViewModel) { return(new OnboardingItemAnalyticsLogger <Events.StartupScanInProgress>(analytics, OnboardingSteps.ScanInProgress)); } else if (analyticsTarget is ScanNowViewModel) { return(new OnboardingItemAnalyticsLogger <Events.StartupScanManualStart>(analytics, OnboardingSteps.ManualStart)); } else if (analyticsTarget is ScanResultNoItemsViewModel) { return(new OnboardingItemAnalyticsLogger <Events.ScanResultsNoItems>(analytics, OnboardingSteps.ScanResultNoItems)); } else if (analyticsTarget is ScanPopupNotificationViewModel) { return(new OnboardingItemAnalyticsLogger <Events.ScanResultsPopUpNotification>(analytics, OnboardingSteps.ScanResultPopupNotification)); } else if (analyticsTarget is StartupScanDisabledViewModel) { return(new OnboardingItemAnalyticsLogger <Events.ScanEventDisabled>(analytics, OnboardingSteps.StartupScanDisabled)); } else if (analyticsTarget is StartupScanEnabledViewModel) { return(new OnboardingItemAnalyticsLogger <Events.ScanEventEnabled>(analytics, OnboardingSteps.StartupScanEnabled)); } return(null); }
public ActionResult GenerateABTestData([FromServices] IABTestManager abTestManager, [FromServices] IAnalyticsLogger analyticsLogger) { if (!IsAdmin()) { return(UnauthorizedView()); } var model = new GeneratorIndexViewModel(); try { var testGenerator = new ABTestConversionGenerator(abTestManager, analyticsLogger); testGenerator.StartTestAndGenerateData(); model.DisplaySuccessMessage = true; } catch (ABTestConversionGeneratorException ex) { model.ABTestErrorMessage = ex.DisplayMessage; } return(View("Index", model)); }
public void Initialize() { AssemblyInjector.Inject(); _analyticsLogger = Substitute.For <IAnalyticsLogger>(); _mockMagpie = new MockMagpie("validContentUrl", analyticsLogger: _analyticsLogger); }