Exemplo n.º 1
0
        public static void SetTestOptions(Pcl.IntegrationTesting.AdjustTestOptions testOptions)
        {
            if (testOptions.Teardown.HasValue && testOptions.Teardown.Value)
            {
                if (AdjustInstance != null)
                {
                    AdjustInstance.Teardown();
                }

                _isApplicationActive = false;
                DeviceUtil           = null;
                AdjustInstance       = null;
                AdjustFactory.Teardown();

                // check whether to delete state
                if (testOptions.DeleteState.HasValue && testOptions.DeleteState.Value)
                {
                    ClearAllPersistedObjects();
                    ClearAllPeristedValues();
                }
            }

            if (AdjustInstance == null)
            {
                AdjustInstance = new AdjustInstance();
            }

            AdjustInstance.SetTestOptions(testOptions);
        }
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();
             * */
        }
        public override void SetUp()
        {
            base.SetUp();

            MockActivityHandler    = new MockActivityHandler(MockLogger);
            MockHttpMessageHandler = new MockHttpMessageHandler(MockLogger);

            AdjustFactory.Logger = MockLogger;
            AdjustFactory.SetActivityHandler(MockActivityHandler);
            AdjustFactory.SetHttpMessageHandler(MockHttpMessageHandler);

            AttributionPackage = GetAttributionPackage();
        }
Exemplo n.º 4
0
        public override void SetUp()
        {
            base.SetUp();

            MockRequestHandler  = new MockRequestHandler(MockLogger);
            MockActivityHandler = new MockActivityHandler(MockLogger);

            AdjustFactory.Logger = MockLogger;
            AdjustFactory.SetRequestHandler(MockRequestHandler);
            AdjustFactory.SetActivityHandler(MockActivityHandler);

            ActivityHandler = GetActivityHandler();

            PackageHandler = StartPackageHandler();
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 7
0
 public override void TearDown()
 {
     AdjustFactory.SetHttpMessageHandler(null);
     AdjustFactory.Logger = null;
 }
Exemplo n.º 8
0
 public override void TearDown()
 {
     AdjustFactory.SetRequestHandler(null);
     AdjustFactory.SetActivityHandler(null);
     AdjustFactory.Logger = null;
 }