コード例 #1
0
        public void Manifest_Should_Call_GrandChild_Validators_If_Populated_And_Bubble_Up_Errors()
        {
            var manifest = new PluginManifest()
            {
                CdsConnection = new CdsConnection()
                {
                    CdsUrl       = "https://testurl.crm.dynamics.com",
                    CdsAppId     = "ID",
                    CdsAppSecret = "SECRET!"
                },
                PluginAssemblies = new CdsPluginAssembly[]
                {
                    new CdsPluginAssembly()
                    {
                        Name         = "Test",
                        FriendlyName = "Friend Test",
                        Assembly     = "c:/fake/test.dll",
                        Plugins      = new CdsPlugin[]
                        {
                            new CdsPlugin()
                            {
                                Name = "Test Plugin"
                            }
                        }
                    }
                }
            };
            var validator = new PluginManifestValidator();
            var result    = validator.Validate(manifest);

            result.IsValid.Should().BeFalse("grandchild plugin has missing mandatory data");
        }
コード例 #2
0
        public void Empty_Manifest_Should_Throw_No_Errors()
        {
            var manifest = new PluginManifest()
            {
                CdsConnection = new CdsConnection()
                {
                    CdsUrl       = "https://testurl.crm.dynamics.com",
                    CdsAppId     = "ID",
                    CdsAppSecret = "SECRET!"
                }
            };
            var validator = new PluginManifestValidator();
            var result    = validator.Validate(manifest);

            result.IsValid.Should().BeTrue("only CDS connection is mandatory in the manifest");
        }