Inheritance: IAttributionHandler
Exemple #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);
        }
        public override void SetUp()
        {
            base.SetUp();

            MockPackageHandler = new MockPackageHandler(MockLogger);
            MockAttributionHandler = new MockAttributionHandler(MockLogger);

            AdjustFactory.Logger = MockLogger;
            AdjustFactory.SetPackageHandler(MockPackageHandler);
            AdjustFactory.SetAttributionHandler(MockAttributionHandler);

            // deleting the activity state file to simulate a first session
            var activityStateDeleted = Util.DeleteFile("AdjustIOActivityState");
            var attributionDeleted = Util.DeleteFile("AdjustAttribution");

            MockLogger.Test("Was the activity state file deleted? {0}", activityStateDeleted);

            MockLogger.Test("Was the attribution file deleted? {0}", attributionDeleted);
        }
        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);
        }
        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;
        }