Exemplo n.º 1
0
        public static ActivityHandler GetActivityHandler(MockLogger mocklogger, DeviceUtil deviceUtil)
        {
            MockAttributionHandler mockAttributionHandler = new MockAttributionHandler(mocklogger);
            MockPackageHandler     mockPackageHandler     = new MockPackageHandler(mocklogger);

            AdjustFactory.SetAttributionHandler(mockAttributionHandler);
            AdjustFactory.SetPackageHandler(mockPackageHandler);

            // create the config to start the session
            AdjustConfig config = new AdjustConfig(appToken: "123456789012", environment: AdjustConfig.EnvironmentSandbox);

            // start activity handler with config
            ActivityHandler activityHandler = ActivityHandler.GetInstance(config, deviceUtil);

            deviceUtil.Sleep(3000);

            return(activityHandler);
        }
        private ActivityPackage GetAttributionPackage()
        {
            MockAttributionHandler mockAttributionHandler = new MockAttributionHandler(MockLogger);
            MockPackageHandler     mockPackageHandler     = new MockPackageHandler(MockLogger);

            AdjustFactory.SetAttributionHandler(mockAttributionHandler);
            AdjustFactory.SetPackageHandler(mockPackageHandler);

            // start activity handler with config
            ActivityHandler activityHandler = UtilTest.GetActivityHandler(MockLogger, DeviceUtil);

            ActivityPackage attributionPackage = activityHandler.GetAttributionPackage();

            TestActivityPackage attributionPackageTest = new TestActivityPackage(attributionPackage);

            attributionPackageTest.TestAttributionPackage();

            MockLogger.Reset();

            return(attributionPackage);
        }