public void OtherParentTaxaTest() { using (ShimsContext.Create()) { //Arrange LoginApplicationUserAndSetSessionVariables(); SetSwedishLanguage(); IUserContext userContext = ApplicationUserContextSV; const int hybridTaxonId = 266838; ITaxon taxon = CoreData.TaxonManager.GetTaxon(userContext, hybridTaxonId); //Act TaxonInfoViewModel model = new TaxonInfoViewModel(taxon, userContext, null, null); //Assert Assert.AreEqual(3, model.OtherParentTaxa.Count); Assert.AreEqual("Artkomplex", model.OtherParentTaxa[0].Category); Assert.AreEqual("Art", model.OtherParentTaxa[1].Category); Assert.AreEqual("Art", model.OtherParentTaxa[2].Category); } }
public void GetAllBiotaParentsHierarchicalTest() { using (ShimsContext.Create()) { //Arrange const int BiotaTaxonId = 0; LoginApplicationUserAndSetSessionVariables(); SetSwedishLanguage(); IUserContext userContext = ApplicationUserContextSV; ITaxon taxon = CoreData.TaxonManager.GetTaxon(userContext, BiotaTaxonId); // Act TaxonInfoViewModel taxonInfoViewModel = new TaxonInfoViewModel(taxon, userContext, null, null); // Assert Assert.IsTrue(taxonInfoViewModel.ParentTaxa != null); Assert.IsTrue(taxonInfoViewModel.ParentTaxa.Count == 0); Assert.IsTrue(taxonInfoViewModel.OtherParentTaxa != null); Assert.IsTrue(taxonInfoViewModel.OtherParentTaxa.Count == 0); } }