public void GbifTaxaClassificationResolver_DefaultConstructor_ShouldWork() { var connectorFactory = new NetConnectorFactory(); var requester = new GbifApiV09DataRequester(connectorFactory); var service = new GbifTaxaClassificationResolver(requester); Assert.IsNotNull(service, "Service should not be null"); }
public void GbifDataRequester_SearchGbif_WithValidTaxonName_ShouldReturnResult() { const string ScientificName = "Coleoptera"; var requester = new GbifApiV09DataRequester(new NetConnectorFactory()); var result = requester.RequestData(ScientificName).Result; Assert.IsNotNull(result, "Result should not be null."); Assert.AreEqual(ScientificName, result.CanonicalName, "CanonicalName should match."); }
public void GbifTaxaClassificationResolver_Resolve_ShouldWork() { const string CanonicalName = "Coleoptera"; const TaxonRankType Rank = TaxonRankType.Order; var connectorFactory = new NetConnectorFactory(); var requester = new GbifApiV09DataRequester(connectorFactory); var service = new GbifTaxaClassificationResolver(requester); var response = service.Resolve(CanonicalName).Result; var defaultClassification = response.FirstOrDefault(); Assert.AreEqual(CanonicalName, defaultClassification.CanonicalName, "CanonicalName should match."); Assert.AreEqual(Rank, defaultClassification.Rank, "Rank should match."); }