Exemplo n.º 1
0
        /// <summary>
        /// Gets the first permitted listing value for the first legislation name.
        /// </summary>
        /// <returns>the permitted listing value</returns>
        protected BOPermittedListingValue GetFirstListingValue()
        {
            BOLegislationNameSummary[] summaries = BOLegislationName.GetNames(true);                    //names that have permitted listing values
            int nameId = summaries[0].Id;

            BOPermittedListingValue[] listings = BOPermittedListingValue.GetByLegislationId(nameId, null);
            return(listings[0]);
        }
Exemplo n.º 2
0
        public void GetPermittedListingValues()
        {
            BOLegislationNameSummary[] summaries1 = BOLegislationName.GetNames(true);                   //names that have permitted listing values
            BOLegislationNameSummary[] summaries2 = BOLegislationName.GetNames(false);                  //names that don't
            int nameId1 = summaries1[0].Id;
            int nameId2 = summaries2[0].Id;

            Assert.IsTrue(BOPermittedListingValue.GetByLegislationId(nameId1, null).Length > 0);
            Assert.IsTrue(BOPermittedListingValue.GetByLegislationId(nameId2, null).Length == 0);
        }
Exemplo n.º 3
0
        public void DeletePermittedListingValue()
        {
            BOLegislationNameSummary[] summaries = BOLegislationName.GetNames(true);                    //names that have permitted listing values
            int nameId = summaries[0].Id;
            int count  = BOPermittedListingValue.GetByLegislationId(nameId, null).Length;
            BOPermittedListingValue listing = AddListingValue(nameId);

            Assert.IsTrue(BOPermittedListingValue.GetByLegislationId(nameId, null).Length == count + 1);
            listing.Delete();
            Assert.IsTrue(BOPermittedListingValue.GetByLegislationId(nameId, null).Length == count);
        }
Exemplo n.º 4
0
        public void GetLegislationNames()
        {
            TaxonomyLegislationNameSet items = TaxonomyLegislationName.GetAll();
            Hashtable names = new Hashtable();

            BOLegislationNameSummary[] summaries1 = BOLegislationName.GetNames(true);
            BOLegislationNameSummary[] summaries2 = BOLegislationName.GetNames(false);

            foreach (TaxonomyLegislationName item in items)             // build a hashtable of all the legislation names
            {
                names.Add(item.LegislationNameID, null);
            }
            RemoveAllNames(names, summaries1);                                          // remove all legislation names that do have permitted listing values
            RemoveAllNames(names, summaries2);                                          // remove all legislation names that don't have permitted listing values
            Assert.IsTrue(names.Count == 0);                                            // should be none left
        }