Exemplo n.º 1
0
        public void Seed_Options_Ok()
        {
            TokenTextLayerPartSeeder seeder = new TokenTextLayerPartSeeder();

            seeder.SetSeedOptions(_seedOptions);
            seeder.Configure(new TokenTextLayerPartSeederOptions
            {
                MaxFragmentCount = 3
            });

            // item with text
            IItem item = _factory.GetItemSeeder().GetItem(1, "facet");
            TokenTextPartSeeder textSeeder = new TokenTextPartSeeder();

            textSeeder.SetSeedOptions(_seedOptions);
            item.Parts.Add(textSeeder.GetPart(_item, null, _factory));

            IPart part = seeder.GetPart(item, "fr.net.fusisoft.comment", _factory);

            Assert.NotNull(part);

            TokenTextLayerPart <CommentLayerFragment> lp =
                part as TokenTextLayerPart <CommentLayerFragment>;

            Assert.NotNull(lp);
            Assert.NotEmpty(lp.Fragments);
        }
Exemplo n.º 2
0
        public void Seed_NoOptions_Null()
        {
            TokenTextLayerPartSeeder seeder = new TokenTextLayerPartSeeder();

            seeder.SetSeedOptions(_seedOptions);

            IPart part = seeder.GetPart(_item, null, _factory);

            Assert.Null(part);
        }
Exemplo n.º 3
0
        public void Seed_OptionsNoText_Null()
        {
            TokenTextLayerPartSeeder seeder = new TokenTextLayerPartSeeder();

            seeder.SetSeedOptions(_seedOptions);
            seeder.Configure(new TokenTextLayerPartSeederOptions
            {
                MaxFragmentCount = 3
            });

            IPart part = seeder.GetPart(_item, "fr.net.fusisoft.comment", _factory);

            Assert.Null(part);
        }
Exemplo n.º 4
0
        public void Seed_InvalidOptions_Null()
        {
            TokenTextLayerPartSeeder seeder = new TokenTextLayerPartSeeder();

            seeder.SetSeedOptions(_seedOptions);
            seeder.Configure(new TokenTextLayerPartSeederOptions
            {
                MaxFragmentCount = 0
            });

            IPart part = seeder.GetPart(_item, null, _factory);

            Assert.Null(part);
        }