コード例 #1
0
        public void ShouldNotDeploy_CSOM_SandboxSolution_WithDotsInFileName()
        {
            var hasException = false;

            var sandbox = ModelGeneratorService.GetRandomDefinition <SandboxSolutionDefinition>(def =>
            {
                def.Activate   = true;
                def.SolutionId = Guid.NewGuid();
                def.FileName   = string.Format("{0}.{1}.wsp", Rnd.String(4), Rnd.String(4));
            });

            try
            {
                var handler = new SPMeta2.CSOM.Standard.ModelHandlers.SandboxSolutionModelHandler();

                handler.DeployModel(null, sandbox);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetType() == typeof(SPMeta2NotSupportedException));
                Assert.IsTrue(ex.Message.Contains("SandboxSolutionDefinition.FileName"));

                hasException = true;
            }

            Assert.IsTrue(hasException);
        }
コード例 #2
0
        public void ShouldNotDeploy_CSOM_SandboxSolution_WithDotsInFileName()
        {
            var hasException = false;

            var sandbox = ModelGeneratorService.GetRandomDefinition<SandboxSolutionDefinition>(def =>
            {
                def.Activate = true;
                def.SolutionId = Guid.NewGuid();
                def.FileName = string.Format("{0}.{1}.wsp", Rnd.String(4), Rnd.String(4));
            });

            try
            {
                var handler = new SPMeta2.CSOM.Standard.ModelHandlers.SandboxSolutionModelHandler();

                handler.DeployModel(null, sandbox);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetType() == typeof(SPMeta2NotSupportedException));
                Assert.IsTrue(ex.Message.Contains("SandboxSolutionDefinition.FileName"));

                hasException = true;
            }

            Assert.IsTrue(hasException);
        }