public void GetSpeciesFactsByIdentifier() { List <WebSpeciesFact> changeSpeciesFacts; List <WebSpeciesFact> oldSpeciesFacts; List <WebSpeciesFact> speciesFacts; // Get same species facts again. oldSpeciesFacts = GetSomeSpeciesFacts(GetContext()); speciesFacts = SpeciesFactManager.GetSpeciesFactsByIdentifier(GetContext(), oldSpeciesFacts); Assert.AreEqual(oldSpeciesFacts.Count, speciesFacts.Count); // Delete some species facts. changeSpeciesFacts = new List <WebSpeciesFact>(); changeSpeciesFacts.Add(speciesFacts[0]); changeSpeciesFacts.Add(speciesFacts[1]); changeSpeciesFacts.Add(speciesFacts[2]); SpeciesFactManager.UpdateSpeciesFacts(GetContext(), null, changeSpeciesFacts, null); speciesFacts = SpeciesFactManager.GetSpeciesFactsByIdentifier(GetContext(), oldSpeciesFacts); Assert.AreEqual(oldSpeciesFacts.Count - 3, speciesFacts.Count); // Create some species facts. SpeciesFactManager.UpdateSpeciesFacts(GetContext(), changeSpeciesFacts, null, null); speciesFacts = SpeciesFactManager.GetSpeciesFactsByIdentifier(GetContext(), oldSpeciesFacts); Assert.AreEqual(oldSpeciesFacts.Count, speciesFacts.Count); }
public void GetSpeciesFactsByIdentifierToManyError() { Int32 speciesFactIndex; List <WebSpeciesFact> speciesFacts; speciesFacts = GetSomeSpeciesFacts(GetContext()); for (speciesFactIndex = 0; speciesFactIndex < (SpeciesFactManager.MAX_SPECIES_FACTS + 2); speciesFactIndex++) { speciesFacts.Add(speciesFacts[0]); } speciesFacts = SpeciesFactManager.GetSpeciesFactsByIdentifier(GetContext(), speciesFacts); Assert.IsNotNull(speciesFacts); }