コード例 #1
0
        public void ImmediateActivationModeIsParsed()
        {
            var obj      = JObject.Parse("{ \"activation\": \"immediate\" }");
            var manifest = new PackageConfiguration(null, obj);

            manifest.GetPackageActivationMode().Should().Be(EntityActivationMode.Immediate);
        }
コード例 #2
0
        public void DeferredActivationModeIsParsed()
        {
            var obj      = JObject.Parse("{ \"activation\": \"deferred\" }");
            var manifest = new PackageConfiguration(null, obj);

            manifest.GetPackageActivationMode().Should().Be(EntityActivationMode.Deferred);
        }
コード例 #3
0
        public void ActivationModeIsImmediateFoEmptyManifest()
        {
            var obj      = JObject.Parse("{}");
            var manifest = new PackageConfiguration(null, obj);

            manifest.GetPackageActivationMode().Should().Be(EntityActivationMode.Immediate);
        }
コード例 #4
0
        public void DisabledPackageStateIsParsed()
        {
            var obj      = JObject.Parse("{ \"enabled\": \"false\" }");
            var manifest = new PackageConfiguration(null, obj);

            manifest.IsPackageEnabled.Should().BeFalse();
        }
コード例 #5
0
        public void PackageIsEnabledForEmptyManifest()
        {
            var obj      = JObject.Parse("{}");
            var manifest = new PackageConfiguration(null, obj);

            manifest.IsPackageEnabled.Should().BeTrue();
        }
コード例 #6
0
        public void EmptyExtensibilityPointsListReturnForEmptyManifest()
        {
            var config   = JObject.Parse("{}");
            var manifest = new PackageConfiguration(null, config);
            var list     = manifest.GetExtensibilityPoints();

            list.Count().Should().Be(0);
        }
コード例 #7
0
        public void EmptyDeploymentHandlersListReturnForEmptyManifest()
        {
            var config   = JObject.Parse("{}");
            var manifest = new PackageConfiguration(null, config);
            var list     = manifest.GetPackageDeploymentHandlers();

            list.Count().Should().Be(0);
        }
コード例 #8
0
        public void ConfigWithThreeDeploymentHandlersParsed()
        {
            var config   = JObject.Parse("{\"deploymentHandlers\": [\"1\",\"2\",\"3\"]}");
            var manifest = new PackageConfiguration(null, config);
            var handlers = manifest.GetPackageDeploymentHandlers();

            var handlersList = new List <DeploymentEventsHandlerInfo>(handlers);

            handlersList.Count.Should().Be(3);
            handlersList[0].ClassName.Should().Be("1");
            handlersList[1].ClassName.Should().Be("2");
            handlersList[2].ClassName.Should().Be("3");
        }
コード例 #9
0
        public void ConfigWithOneExtensibilityPointParsed()
        {
            var config     = JObject.Parse("{ \"extensibilityPoints\": [ {\"id\" : \"id\", \"activation\": \"deferred\", \"class\": \"test\", \"configuration\": {\"var\" : \"hello\"} } ] }");
            var manifest   = new PackageConfiguration(null, config);
            var extensions = manifest.GetExtensibilityPoints();

            var extensionList = new List <ExtensibilityPointInfo>(extensions);

            extensionList.Count.Should().Be(1);
            extensionList[0].Id.Should().Be("id");
            extensionList[0].ActivationMode.Should().Be(EntityActivationMode.Deferred);
            extensionList[0].ClassName.Should().Be("test");

            var customConfig = extensionList[0].CustomConfiguration.Get();

            customConfig.HasChildren().Should().BeTrue();
            customConfig.GetChild("var").Value.Should().Be("hello");
        }