Exemplo n.º 1
0
        public SPMeta2RegresionScenarioTestBase()
        {
            RegressionService.ProvisionGenerationCount = 2;
            RegressionService.ShowOnlyFalseResults     = false;

            Rnd = new DefaultRandomService();
        }
Exemplo n.º 2
0
        public SPMeta2RegresionTestCoreBase()
        {
            Rnd = new DefaultRandomService();

            ModelGeneratorService = new ModelGeneratorService();
            ModelGeneratorService.RegisterDefinitionGenerators(typeof(ImageRenditionDefinitionGenerator).Assembly);
        }
        public void ClientRuntimeContextService_Should_ThrowGenericException_On_UnsupportHttpStatuses()
        {
            // expecting web exception on unknown http statuses

            var currentReconnectCount = 0;
            var service = new DefaultClientRuntimeContextService();

            var rndService            = new DefaultRandomService();
            var supportedHttpStatuses = new[]
            {
                700, 800, 900
            };

            // to run test faster
            service.ExecuteQueryDelayInMilliseconds = 1;

            service.CustomExecuteQueryHandler += (cnt) =>
            {
                currentReconnectCount++;

                var webResponce = Activator.CreateInstance <HttpWebResponse>();

                var sttausCode = rndService.RandomFromArray(supportedHttpStatuses);
                SetStatusCode(webResponce, sttausCode);

                var ex = new WebException("Can't connect to O365", null,
                                          (WebExceptionStatus)402, webResponce);

                throw ex;
            };

            service.ExecuteQuery(default(ClientRuntimeContext));
        }
Exemplo n.º 4
0
        public IncrementalModelTreeTraverseServiceTests()
        {
            ModelPrintService = new DefaultIncrementalModelPrettyPrintService();

            Rnd = new DefaultRandomService();

            ModelGeneratorService = new ModelGeneratorService();
            ModelGeneratorService.RegisterDefinitionGenerators(typeof(ImageRenditionDefinitionGenerator).Assembly);
        }
        public SSOMListViewLookupServiceTests()
        {
            Service         = new SSOMListViewLookupService();
            ProvisionRunner = new SSOMProvisionRunner();
            Rnd             = new DefaultRandomService();

            ModelGeneratorService = new ModelGeneratorService();
            ModelGeneratorService.RegisterDefinitionGenerators(typeof(ImageRenditionDefinitionGenerator).Assembly);

            ProvisionRunner.EnableDefinitionProvision  = true;
            ProvisionRunner.EnableDefinitionValidation = false;
        }
Exemplo n.º 6
0
        public ReverseTestBase()
        {
            SiteUrl = RunnerEnvironmentUtils.GetEnvironmentVariables(EnvironmentConsts.O365_SiteUrls).First();

            UserName     = RunnerEnvironmentUtils.GetEnvironmentVariable(EnvironmentConsts.O365_UserName);
            UserPassword = RunnerEnvironmentUtils.GetEnvironmentVariable(EnvironmentConsts.O365_Password);

            AssertService = new VSAssertService();

            ModelGeneratorService = new ModelGeneratorService();

            ModelGeneratorService.RegisterDefinitionGenerators(typeof(FieldDefinitionGenerator).Assembly);
            ModelGeneratorService.RegisterDefinitionGenerators(typeof(TaxonomyTermDefinitionGenerator).Assembly);

            Rnd = new DefaultRandomService();
        }
        public void ClientRuntimeContextService_Should_SupportHttpStatuses()
        {
            // expecting SPMeta2Exception on known http statuses

            var currentReconnectCount = 0;
            var service = new DefaultClientRuntimeContextService();

            var rndService            = new DefaultRandomService();
            var supportedHttpStatuses = new[]
            {
                429, 503
            };

            // to run test faster
            service.ExecuteQueryDelayInMilliseconds = 1;

            service.CustomExecuteQueryHandler += (cnt) =>
            {
                currentReconnectCount++;

                var webResponce = Activator.CreateInstance <HttpWebResponse>();

                var sttausCode = rndService.RandomFromArray(supportedHttpStatuses);
                SetStatusCode(webResponce, sttausCode);

                var ex = new WebException("Can't connect to O365", null,
                                          (WebExceptionStatus)402, webResponce);

                throw ex;
            };
            try
            {
                service.ExecuteQuery(default(ClientRuntimeContext));
            }
            catch (Exception e)
            {
                Assert.AreEqual(currentReconnectCount, service.ExecuteQueryRetryAttempts);
                Assert.IsTrue(e is SPMeta2Exception);
            }
        }
 public ExpectUpdateValueServiceBase()
 {
     RndService = new DefaultRandomService();
 }
Exemplo n.º 9
0
 public ModelNodesTests()
 {
     Rnd = new DefaultRandomService();
 }
Exemplo n.º 10
0
 public DefaultTryRetryServiceTests()
 {
     Rnd = new DefaultRandomService();
 }
 public TypedDefinitionGeneratorServiceBase()
 {
     Rnd = new DefaultRandomService();
 }
 public SPMeta2RegresionScenarioTestBase()
 {
     RegressionService.ProvisionGenerationCount = 2;
     Rnd = new DefaultRandomService();
 }
 public DefaultModelStatInfoServiceTests()
 {
     Service = new DefaultModelStatInfoService();
     Rnd     = new DefaultRandomService();
 }
Exemplo n.º 14
0
 public TraceSourceServiceTests()
 {
     Service = new TraceSourceService();
     Rnd     = new DefaultRandomService();
 }
Exemplo n.º 15
0
 public ModelHandlerTestBase()
 {
     Rnd = new DefaultRandomService();
 }