public void GetPicturesBySearchCriteria() { PictureList pictures; IPicturesSearchCriteria searchCriteria; // Test factors. searchCriteria = new PicturesSearchCriteria { Factors = new FactorList { CoreData.FactorManager.GetFactor(GetUserContext(), 2551) } }; pictures = GetPictureManager(true).GetPictures(GetUserContext(), searchCriteria); Assert.IsTrue(pictures.IsNotEmpty()); // Test taxa. searchCriteria = new PicturesSearchCriteria { Taxa = new TaxonList { CoreData.TaxonManager.GetTaxon(GetUserContext(), 233621) } }; pictures = GetPictureManager().GetPictures(GetUserContext(), searchCriteria); Assert.IsTrue(pictures.IsNotEmpty()); // Test factors and taxa. // Test species fact identifiers. searchCriteria = new PicturesSearchCriteria { Factors = new FactorList { CoreData.FactorManager.GetFactor(GetUserContext(), 2577) }, Taxa = new TaxonList { CoreData.TaxonManager.GetTaxon(GetUserContext(), 101932) } }; pictures = GetPictureManager().GetPictures(GetUserContext(), searchCriteria); Assert.IsTrue(pictures.IsNotEmpty()); // Test metadata (on db). searchCriteria = new PicturesSearchCriteria { MetaData = new PictureMetaDataList { new PictureMetaData { Id = 1, Value = "2014" }, new PictureMetaData { Id = 2 } } }; pictures = GetPictureManager().GetPictures(GetUserContext(), searchCriteria); Assert.IsTrue(pictures.IsNotEmpty()); }
public void GetPicturesInformationBySearchCriteria_With_Empty_MetaDataList() { List <IPictureInformation> pictureInformations; IPicturesSearchCriteria searchCriteria; List <int> metaData = new List <int>(); // Test factors. searchCriteria = new PicturesSearchCriteria { Factors = new FactorList { CoreData.FactorManager.GetFactor(GetUserContext(), 2551) } }; pictureInformations = GetPictureManager(true).GetPicturesInformation(GetUserContext(), searchCriteria, null, null, null, string.Empty, metaData); Assert.IsTrue(pictureInformations.IsNotEmpty()); // Test taxa. searchCriteria = new PicturesSearchCriteria { Taxa = new TaxonList { CoreData.TaxonManager.GetTaxon(GetUserContext(), 233621) } }; pictureInformations = GetPictureManager().GetPicturesInformation(GetUserContext(), searchCriteria, null, null, null, string.Empty, metaData); Assert.IsTrue(pictureInformations.IsNotEmpty()); // Test factors and taxa. // Test species fact identifiers. searchCriteria = new PicturesSearchCriteria { Factors = new FactorList { CoreData.FactorManager.GetFactor(GetUserContext(), 2577) }, Taxa = new TaxonList { CoreData.TaxonManager.GetTaxon(GetUserContext(), 101932) } }; pictureInformations = GetPictureManager().GetPicturesInformation(GetUserContext(), searchCriteria, null, null, null, string.Empty, metaData); Assert.IsTrue(pictureInformations.IsNotEmpty()); }