Inheritance: IPackageHandler
Exemplo n.º 1
0
        public override void SetUp()
        {
            base.SetUp();

            AdjustFactory.Logger = MockLogger;

            var activityHandler = UtilTest.GetActivityHandler(MockLogger, DeviceUtil);

            MockLogger.Reset();

            ClickPackage = UtilTest.CreateClickPackage(activityHandler, "");

            MockHttpMessageHandler = new MockHttpMessageHandler(MockLogger);
            AdjustFactory.SetHttpMessageHandler(MockHttpMessageHandler);

            MockPackageHandler = new MockPackageHandler(MockLogger);
            RequestHandler = new RequestHandler(MockPackageHandler);
            /*
            var packageBuilder = new PackageBuilder()
            {
                UserAgent = DeviceUtil.GetUserAgent(),
                ClientSdk = DeviceUtil.ClientSdk,
            };
            SessionPackage = packageBuilder.BuildSessionPackage();
             * */
        }
Exemplo n.º 2
0
        public override void SetUp()
        {
            base.SetUp();

            AdjustFactory.Logger = MockLogger;

            var activityHandler = UtilTest.GetActivityHandler(MockLogger, DeviceUtil);

            MockLogger.Reset();

            ClickPackage = UtilTest.CreateClickPackage(activityHandler, "");

            MockHttpMessageHandler = new MockHttpMessageHandler(MockLogger);
            AdjustFactory.SetHttpMessageHandler(MockHttpMessageHandler);

            MockPackageHandler = new MockPackageHandler(MockLogger);
            RequestHandler     = new RequestHandler(MockPackageHandler);

            /*
             * var packageBuilder = new PackageBuilder()
             * {
             *  UserAgent = DeviceUtil.GetUserAgent(),
             *  ClientSdk = DeviceUtil.ClientSdk,
             * };
             * SessionPackage = packageBuilder.BuildSessionPackage();
             * */
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 6
0
        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;
        }