public void t_Site_Delete() { Location_ado location = null; // backdoor data setup DbTestHelper.LoadAdoObjects(delegate(IbaUnitTestEntities iba) { location = Location_ado.CreateLocation_ado(new Guid("87606168-3ac7-402a-8ae6-4f6905555581"), "locationName", LookupConstants.LocationTypeSite); location.CodeName = "abc"; location.Latitude = 89.3M; location.Longitude = 90.10093M; location.ParentLocationId = null; iba.AddToLocation_ado(location); }); List <Location_ado> locationlist = DbTestHelper.LoadExtraneousLocations(); SiteMapper.Delete(new Site() { Id = location.LocationId }); // Validate results using (IbaUnitTestEntities iba = new IbaUnitTestEntities()) { var siteQuery = from sites in iba.Site_ado select sites; Assert.IsNotNull(siteQuery, "Query result is null"); Assert.AreEqual(extraSites(locationlist).Count(), siteQuery.Count(), "Wrong number of results in query"); validateExtraLocations(locationlist, siteQuery); } }
private void loadASite() { DbTestHelper.LoadAdoObjects((IbaUnitTestEntities iba) => { Location_ado site = Location_ado.CreateLocation_ado(TestHelper.TestParentGuid, "Parent", LookupConstants.LocationTypeSite); iba.AddToLocation_ado(site); }); }
private static void validateResults(Location_ado location, Site site) { Assert.AreEqual(location.CodeName, site.CodeName, "CodeName"); Assert.AreEqual(location.Latitude, site.GeoCoordinate.Latitude.Value, "Latitude"); Assert.AreEqual(location.LocationId, site.Id, "Id"); Assert.AreEqual(location.LocationName, site.Name, "name"); Assert.AreEqual(location.Longitude, site.GeoCoordinate.Longitude.Value, "Longitude"); }
public void t_SamplingPointMapper_Save_Update() { Location_ado location = null; // backdoor data setup DbTestHelper.LoadAdoObjects(delegate(IbaUnitTestEntities iba) { location = Location_ado.CreateLocation_ado(TestHelper.TestGuid1, "locationName", LookupConstants.LocationTypePoint); location.CodeName = "abc"; location.Latitude = 89.3M; location.Longitude = 90.10093M; location.ParentLocationId = TestHelper.TestParentGuid; iba.AddToLocation_ado(location); }); List <Location_ado> extraList = DbTestHelper.LoadExtraneousLocations(); // Setup object to be saved. Change everything except the Id. SamplingPoint site = new SamplingPoint() { GeoCoordinate = new Business.DataTypes.Coordinate() { Latitude = new Business.DataTypes.Degree() { Value = location.Latitude.Value + 1M }, Longitude = new Business.DataTypes.Degree() { Value = location.Longitude.Value + 1M } }, Id = location.LocationId, Name = location.LocationName + "asd", SiteId = TestHelper.TestParentGuid }; // Execute the test SamplingPointMapper.Update(site); // Validate results using (IbaUnitTestEntities iba = new IbaUnitTestEntities()) { var siteQuery = from sites in iba.SamplingPoint_ado select sites; Assert.IsNotNull(siteQuery, "Query result is null"); Assert.AreEqual(extraSamplingPoints(extraList).Count() + 1, siteQuery.Count(), "Wrong number of results in query"); SamplingPoint_ado adoSite = siteQuery.First(x => x.LocationId == TestHelper.TestGuid1); validateObjectEquality(site, adoSite); // double check the other objects as well, must make sure they remain unchanged. foreach (Location_ado adoLocation in extraSamplingPoints(extraList)) { adoSite = siteQuery.First(x => x.LocationId == adoLocation.LocationId); Assert.IsNotNull(adoSite, "There is no longer an object with id " + adoLocation.LocationId.ToString()); Assert.AreEqual(adoLocation.Latitude, adoSite.Latitude, "Extra " + adoSite.LocationId.ToString() + " Latitude mismatch"); Assert.AreEqual(adoLocation.Longitude, adoSite.Longitude, "Extra " + adoSite.LocationId.ToString() + " Longitude mismatch"); Assert.AreEqual(adoSite.LocationName, adoSite.LocationName, "Extra " + adoSite.LocationId.ToString() + " Locationname mismatch"); } } }
private static void validateResults(Location_ado location, SamplingPoint point) { Assert.IsNotNull(point, "Point object is null"); Assert.IsNotNull(point.GeoCoordinate, "Coordinates are null"); Assert.AreEqual(location.Latitude, point.GeoCoordinate.Latitude.Value, "Latitude"); Assert.AreEqual(location.LocationId, point.Id, "Id"); Assert.AreEqual(location.LocationName, point.Name, "name"); Assert.AreEqual(location.Longitude, point.GeoCoordinate.Longitude.Value, "Longitude"); Assert.AreEqual(location.ParentLocationId, point.SiteId, "SiteId"); }
public static Location_ado LoadSamplingPoint(Guid pointId, Guid siteId) { Location_ado point1 = null; LoadAdoObjects((IbaUnitTestEntities iba) => { point1 = Location_ado.CreateLocation_ado(pointId, "Point " + pointId.ToString().Substring(0, 5), LookupConstants.LocationTypePoint); iba.AddToLocation_ado(point1); }); return(point1); }
public void t_SamplingPointMapper_Delete() { Location_ado location = null; // backdoor data setup DbTestHelper.LoadAdoObjects(delegate(IbaUnitTestEntities iba) { location = Location_ado.CreateLocation_ado(TestHelper.TestParentGuid, "locationName", LookupConstants.LocationTypeSite); location.CodeName = "abc"; location.Latitude = 89.3M; location.Longitude = 90.10093M; location.ParentLocationId = null; iba.AddToLocation_ado(location); }); Location_ado pointAdo = null; DbTestHelper.LoadAdoObjects((IbaUnitTestEntities iba) => { pointAdo = Location_ado.CreateLocation_ado(TestHelper.TestGuid1, "pointName", LookupConstants.LocationTypePoint); location.ParentLocationId = TestHelper.TestParentGuid; iba.AddToLocation_ado(pointAdo); }); List <Location_ado> extraList = DbTestHelper.LoadExtraneousLocations(); SamplingPoint point = new SamplingPoint() { Id = TestHelper.TestGuid1, SiteId = TestHelper.TestParentGuid }; // Exercise the system under test SamplingPointMapper.Delete(point); // Validate that the one record was deleted but none others were using (IbaUnitTestEntities iba = new IbaUnitTestEntities()) { var pointQuery = from points in iba.Location_ado select points; Assert.IsNotNull(pointQuery, "Query result is null"); Assert.AreEqual(0, pointQuery.Count(x => x.LocationId == point.Id), "Point wasn't deleted"); // Check to see if extra points and locations are still in the database foreach (Location_ado extra in extraList) { Assert.AreEqual(1, pointQuery.Count(x => x.LocationId == extra.LocationId), "Location " + extra.LocationId.ToString() + " is no longer in the database."); } Assert.AreEqual(1, pointQuery.Count(x => x.LocationId == location.LocationId), "Parent was deleted"); } }
public void t_Site_Save_Update() { Location_ado location = null; // backdoor data setup DbTestHelper.LoadAdoObjects(delegate(IbaUnitTestEntities iba) { location = Location_ado.CreateLocation_ado(TestHelper.TestGuid1, "locationName", LookupConstants.LocationTypeSite); location.CodeName = "abc"; location.Latitude = 89.3M; location.Longitude = 90.10093M; location.ParentLocationId = null; iba.AddToLocation_ado(location); }); List <Location_ado> extraList = DbTestHelper.LoadExtraneousLocations(); // Setup object to be saved. Change everything except the Id. Site site = new Site() { CodeName = location.CodeName + "a", GeoCoordinate = new Business.DataTypes.Coordinate() { Latitude = new Business.DataTypes.Degree() { Value = location.Latitude.Value + 1M }, Longitude = new Business.DataTypes.Degree() { Value = location.Longitude.Value + 1M } }, Id = location.LocationId, Name = location.LocationName + "asd" }; // Execute the test SiteMapper.Update(site); // Validate results using (IbaUnitTestEntities iba = new IbaUnitTestEntities()) { var siteQuery = from sites in iba.Site_ado select sites; Assert.IsNotNull(siteQuery, "Query result is null"); Assert.AreEqual(extraSites(extraList).Count() + 1, siteQuery.Count(), "Wrong number of results in query"); Site_ado adoSite = siteQuery.First(x => x.LocationId == TestHelper.TestGuid1); validateObjectEquality(site, adoSite); validateExtraLocations(extraList, siteQuery); } }
/// <summary> /// Loads extra records into the Location table, useful for insuring that selects and updates are truly updating the right /// record, rather than all records (unless ALL is what was intended). /// </summary> public static List <Location_ado> LoadExtraneousLocations() { List <Location_ado> locationList = new List <Location_ado>(); Location_ado extra1 = null; LoadAdoObjects(delegate(IbaUnitTestEntities iba) { extra1 = Location_ado.CreateLocation_ado(TestHelper.TestGuid2, "locationName", LookupConstants.LocationTypeSite); extra1.CodeName = "ex1"; extra1.Latitude = 89.3M; extra1.Longitude = 90.10093M; extra1.ParentLocationId = null; iba.AddToLocation_ado(extra1); }); locationList.Add(extra1); Location_ado extra2 = null; LoadAdoObjects(delegate(IbaUnitTestEntities iba) { extra2 = Location_ado.CreateLocation_ado(TestHelper.TestGuid3, "locationName", LookupConstants.LocationTypeSite); extra2.CodeName = "ex2"; extra2.Latitude = 69.3M; extra2.Longitude = 90.10293M; extra2.ParentLocationId = null; iba.AddToLocation_ado(extra2); }); locationList.Add(extra2); Location_ado extra3 = null; LoadAdoObjects(delegate(IbaUnitTestEntities iba) { extra3 = Location_ado.CreateLocation_ado(TestHelper.TestGuid4, "locationName", LookupConstants.LocationTypePoint); extra3.CodeName = string.Empty; extra3.Latitude = 79.3M; extra3.Longitude = 91.10093M; extra3.ParentLocationId = TestHelper.TestGuid3; iba.AddToLocation_ado(extra3); }); locationList.Add(extra3); return(locationList); }
private void setupOakwood() { Location_ado site = Location_ado.CreateLocation_ado(TestHelper.TestGuid1, OAKWOOD, LookupConstants.LocationTypeSite); Location_ado point = Location_ado.CreateLocation_ado(TestHelper.TestGuid2, "Point", LookupConstants.LocationTypePoint); point.ParentLocationId = site.LocationId; SiteVisit_ado visit = DbTestHelper.LoadSingleSiteVisit(TestHelper.TestGuid1, site.LocationId, DateTime.Now.AddHours(-7)); PointSurvey_ado survey = PointSurvey_ado.CreatePointSurvey_ado(TestHelper.TestGuid2, point.LocationId, DateTime.Now.AddHours(-7), DateTime.Now.AddHours(-6)); survey.SiteVisitId = visit.EventId; DbTestHelper.LoadAdoObjects((IbaUnitTestEntities iba) => { iba.AddToPointSurvey_ado1(survey); iba.AddToLocation_ado(site); iba.AddToLocation_ado(point); iba.SaveChanges(); }); List <Observation_ado> obsList = new List <Observation_ado>(); addABunchOfObservations(obsList, 35, List[0].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 26, List[1].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 21, List[2].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 16, List[3].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 11, List[4].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 6, List[5].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 5, List[6].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 3, List[7].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 3, List[8].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 3, List[9].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 3, List[10].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 3, List[11].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 2, List[12].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 2, List[13].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 2, List[14].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 1, List[15].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 1, List[16].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 1, List[17].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 1, List[18].SpeciesId, survey.EventId); addABunchOfObservations(obsList, 25, List[19].SpeciesId, survey.EventId); loadObservations(obsList); }
public void t_SamplingPointMapper_Select_ByGuid() { Location_ado location = null; // backdoor data setup DbTestHelper.LoadAdoObjects(delegate(IbaUnitTestEntities iba) { location = Location_ado.CreateLocation_ado(TestHelper.TestGuid1, "locationName", LookupConstants.LocationTypePoint); location.Latitude = 89.3M; location.Longitude = 90.10093M; location.ParentLocationId = TestHelper.TestParentGuid; iba.AddToLocation_ado(location); }); DbTestHelper.LoadExtraneousLocations(); // Exercise the test SamplingPoint site = SamplingPointMapper.Select(location.LocationId); validateResults(location, site); }
public void t_Site_Select_ByCodeName() { Location_ado location = null; // backdoor data setup DbTestHelper.LoadAdoObjects(delegate(IbaUnitTestEntities iba) { location = Location_ado.CreateLocation_ado(new Guid("87606168-3ac7-402a-8ae6-4f6905555581"), "locationName", LookupConstants.LocationTypeSite); location.CodeName = "abc"; location.Latitude = 89.3M; location.Longitude = 90.10093M; location.ParentLocationId = null; iba.AddToLocation_ado(location); }); DbTestHelper.LoadExtraneousLocations(); // Exercise the test Site site = SiteMapper.Select_ByCodeName(location.CodeName); validateResults(location, site); }
public static List <Location_ado> LoadSites() { List <Location_ado> siteList = new List <Location_ado>(); LoadAdoObjects((IbaUnitTestEntities iba) => { Location_ado site1 = Location_ado.CreateLocation_ado(TestHelper.TestGuid1, "Location 1", LookupConstants.LocationTypeSite); iba.AddToLocation_ado(site1); siteList.Add(site1); Location_ado site2 = Location_ado.CreateLocation_ado(TestHelper.TestGuid2, "Location 2", LookupConstants.LocationTypeSite); iba.AddToLocation_ado(site2); siteList.Add(site2); Location_ado site3 = Location_ado.CreateLocation_ado(TestHelper.TestGuid3, "Location 3", LookupConstants.LocationTypeSite); iba.AddToLocation_ado(site3); siteList.Add(site3); }); return(siteList); }
public void t_BMDE_IncompleteSurvey() { DbTestHelper.LoadSinglePerson(PersonFirstName, PersonLastName, PersonGuid); List <Location_ado> locations = DbTestHelper.LoadExtraneousLocations(); DbTestHelper.LoadAdoObjects((IbaUnitTestEntities iba) => { DateTime startDateTimeme = DateTime.Now; SiteVisit_ado ado = SiteVisit_ado.CreateSiteVisit_ado(SiteVisitGuid, true, locations[0].LocationId, DateTime.Now.AddHours(-1), DateTime.Now, TestHelper.TestGuid1); ado.IsDataEntryComplete = false; // force incompletion iba.AddToSiteVisit_ado1(ado); }); Location_ado point = locations.First(x => x.ParentLocationId != null); DbTestHelper.LoadSinglePointSurvey(PointSurveyGuid, SiteVisitGuid, point.LocationId, DateTime.Now, DateTime.Now.AddHours(1)); DbTestHelper.LoadExtraneousObservations(PointSurveyGuid); string bmde = ResultsMapper.GetBMDE(); Assert.AreEqual(string.Empty, bmde); }
[Ignore] // this is getting an XML error and it is not worth trying to fix it right now. 2014-12-26. public void t_BMDE_CompleteSurvey_TwoObservations() { DbTestHelper.LoadSinglePerson(PersonFirstName, PersonLastName, PersonGuid); List <Location_ado> locations = DbTestHelper.LoadExtraneousLocations(); DateTime startDate = DateTime.Now.AddHours(-2); DateTime endDate = DateTime.Now; DateTime surveyDate = endDate.AddMinutes(-5); DateTime surveyDate2 = surveyDate.AddMinutes(-5); DbTestHelper.LoadAdoObjects((IbaUnitTestEntities iba) => { DateTime startDateTimeme = DateTime.Now; SiteVisit_ado ado = SiteVisit_ado.CreateSiteVisit_ado(SiteVisitGuid, true, locations[0].LocationId, startDate, endDate, TestHelper.TestGuid1); ado.IsDataEntryComplete = true; ado.RecorderId = PersonGuid; ado.ObserverId = PersonGuid; iba.SiteVisit_ado1.AddObject(ado); }); Location_ado point = locations.First(x => x.ParentLocationId != null); Location_ado point2 = locations.Last(); DbTestHelper.LoadSinglePointSurvey(PointSurveyGuid, SiteVisitGuid, point.LocationId, surveyDate, endDate); DbTestHelper.LoadSinglePointSurvey(PointSurveyGuid2, SiteVisitGuid, point2.LocationId, surveyDate2, surveyDate); DbTestHelper.LoadAdoObjects((IbaUnitTestEntities iba) => { Observation_ado observation = Observation_ado.CreateObservation_ado(0, PointSurveyGuid, new Guid(TestHelper.SPECIES_1_ID), PointCountBeyond50.ObservationTypeGuid); Observation_ado observation2 = Observation_ado.CreateObservation_ado(0, PointSurveyGuid, new Guid(TestHelper.SPECIES_1_ID), PointCountBeyond50.ObservationTypeGuid); Observation_ado observation3 = Observation_ado.CreateObservation_ado(0, PointSurveyGuid2, new Guid(TestHelper.SPECIES_2_ID), PointCountWithin50.ObservationTypeGuid); iba.Observation_ado.AddObject(observation); iba.Observation_ado.AddObject(observation2); iba.Observation_ado.AddObject(observation3); }); string bmde = ResultsMapper.GetBMDE(); ASCIIEncoding encoding = new ASCIIEncoding(); using (MemoryStream stream = new MemoryStream(encoding.GetBytes(bmde))) { XmlSerializer serializer = new XmlSerializer(typeof(ObservationList)); serializer.UnknownAttribute += new XmlAttributeEventHandler(serializer_UnknownAttribute); serializer.UnknownElement += new XmlElementEventHandler(serializer_UnknownElement); serializer.UnknownNode += new XmlNodeEventHandler(serializer_UnknownNode); serializer.UnreferencedObject += new UnreferencedObjectEventHandler(serializer_UnreferencedObject); ObservationList obslist = (ObservationList)serializer.Deserialize(stream); Assert.AreEqual(2, obslist.Observation.Count(), "wrong Observation count"); ObservationListObservation actual = obslist.Observation[0]; Assert.AreEqual("Yes", actual.AllIndividualsReported, "AllIndividualsReported"); Assert.AreEqual("observation", actual.BasisOfRecord, "BasisOfRecord"); Assert.IsTrue(!string.IsNullOrEmpty(actual.CatalogNumber), "CatalogNumber"); Assert.AreEqual(PersonFirstName + " " + PersonLastName, actual.Collector, "Collector"); Assert.AreEqual(TestHelper.SPECIES_1_COMMON, actual.CommonName, "CommonName"); Assert.AreEqual("North America", actual.Continent, "Continent"); Assert.AreEqual("null", actual.CoordinateUncertainty, "CoordinateUncertainty"); Assert.AreEqual("United States of America", actual.Country, "Country"); Assert.AreEqual(startDate.Day, actual.DayCollected, "DayCollected"); Assert.AreEqual(point.Latitude.Value, actual.DecimalLatitude, "DecimalLatitude"); Assert.AreEqual(point.Longitude, actual.DecimalLongitude, "DecimalLongitude"); Assert.AreEqual("Unlimited", actual.DistanceFromObserverMax, "DistanceFromObserverMax"); Assert.AreEqual("50 m", actual.DistanceFromObserverMin, "DistanceFromObserverMin"); Assert.AreEqual((endDate - surveyDate).TotalHours.ToString("00.00"), actual.DurationInHours.ToString("00.00"), "DurationInHours"); string genus = TestHelper.SPECIES_1_SCIENTIFIC.Split(' ')[0]; string species = TestHelper.SPECIES_1_SCIENTIFIC.Split(' ')[1]; Assert.AreEqual(genus, actual.Genus, "Genus"); Assert.AreEqual(startDate.DayOfYear, actual.JulianDay, "JulianDay"); Assert.AreEqual(point.LocationName, actual.Locality, "Locality"); Assert.AreEqual(startDate.Month, actual.MonthCollected, "MonthCollected"); Assert.AreEqual(1, actual.NumberOfObservers, "NumberOfObservers"); Assert.AreEqual(2, actual.ObservationCount, "ObservationCount"); Assert.AreEqual(startDate.ToString("MM/dd/yyyy"), actual.ObservationDate, "ObservationDate"); Assert.AreEqual("decimal degrees", actual.OriginalCoordinateSystem, "OriginalCoordinateSystem"); Assert.AreEqual("Homayoun, T. Z. and R. B. Blair. 2009. Citizen-Science Monitoring of Landbirds in the Mississippi River Twin Cities Important Bird Area. Pages 607-616 in T.D., Rich, C. Arizmendi, D. Demarest and C. Thompson, editors. Tundra to Tropics: Connecting Birds, Habitats and People. Proceedings of the 4th International Partners in Flight Conference, 13-16 February 2008, McAllen, TX. Partners in Flight.", actual.ProtocolReference, "ProtocolReference"); Assert.AreEqual("Point Count", actual.ProtocolType, "ProtocolType"); Assert.AreEqual("http://www.partnersinflight.org/pubs/McAllenProc/articles/PIF09_Monitoring/Homayoun_PIF09.pdf", actual.ProtocolURL, "ProtocolURL"); Assert.AreEqual("Restricted", actual.RecordPermissions, "RecordPermissions"); Assert.AreEqual(locations[0].LocationId.ToString().ToUpper(), actual.RouteIdentifier, "RouteIdentifier"); Assert.AreEqual(PointSurveyGuid.ToString().ToUpper(), actual.SamplingEventIdentifier, "SamplingEventIdentifier"); Assert.AreEqual(TestHelper.SPECIES_1_SCIENTIFIC, actual.ScientificName, "ScientificName"); Assert.AreEqual(TestHelper.SPECIES_1_CODE, actual.SpeciesCode, "SpeciesCode"); Assert.AreEqual(species, actual.SpecificEpithet, "SpecificEpithet"); Assert.AreEqual("Minnesota", actual.StateProvince, "StateProvince"); Assert.AreEqual(point.LocationId.ToString().ToUpper(), actual.SurveyAreaIdentifier, "SurveyAreaIdentifier"); Assert.AreEqual((surveyDate.TimeOfDay.Hours + surveyDate.TimeOfDay.Minutes / 60.0).ToString("00.00"), actual.TimeCollected.ToString("00.00"), "TimeCollected"); Assert.AreEqual((endDate.TimeOfDay.Hours + endDate.TimeOfDay.Minutes / 60.0).ToString("00.00"), actual.TimeObservationsEnded.ToString("00.00"), "TimeObservationsEnded"); Assert.AreEqual(surveyDate.TimeOfDay.TotalHours.ToString("00.00"), actual.TimeObservationsStarted.ToString("00.00"), "TimeObservationsStarted"); Assert.AreEqual(startDate.Year.ToString(), actual.YearCollected.ToString(), "YearCollected"); actual = obslist.Observation[1]; Assert.AreEqual("Yes", actual.AllIndividualsReported, "AllIndividualsReported"); Assert.AreEqual("observation", actual.BasisOfRecord, "BasisOfRecord"); Assert.IsTrue(!string.IsNullOrEmpty(actual.CatalogNumber), "CatalogNumber"); Assert.AreEqual(PersonFirstName + " " + PersonLastName, actual.Collector, "Collector"); Assert.AreEqual(TestHelper.SPECIES_2_COMMON, actual.CommonName, "CommonName"); Assert.AreEqual("North America", actual.Continent, "Continent"); Assert.AreEqual("null", actual.CoordinateUncertainty, "CoordinateUncertainty"); Assert.AreEqual("United States of America", actual.Country, "Country"); Assert.AreEqual(startDate.Day, actual.DayCollected, "DayCollected"); Assert.AreEqual(point2.Latitude.Value, actual.DecimalLatitude, "DecimalLatitude"); Assert.AreEqual(point2.Longitude, actual.DecimalLongitude, "DecimalLongitude"); Assert.AreEqual("50 m", actual.DistanceFromObserverMax, "DistanceFromObserverMax"); Assert.AreEqual("0 m", actual.DistanceFromObserverMin, "DistanceFromObserverMin"); Assert.AreEqual((surveyDate - surveyDate2).TotalHours.ToString("00.00"), actual.DurationInHours.ToString("00.00"), "DurationInHours"); genus = TestHelper.SPECIES_2_SCIENTIFIC.Split(' ')[0]; species = TestHelper.SPECIES_2_SCIENTIFIC.Split(' ')[1]; Assert.AreEqual(genus, actual.Genus, "Genus"); Assert.AreEqual(startDate.DayOfYear, actual.JulianDay, "JulianDay"); Assert.AreEqual(point.LocationName, actual.Locality, "Locality"); Assert.AreEqual(startDate.Month, actual.MonthCollected, "MonthCollected"); Assert.AreEqual(1, actual.NumberOfObservers, "NumberOfObservers"); Assert.AreEqual(1, actual.ObservationCount, "ObservationCount"); Assert.AreEqual(startDate.ToString("MM/dd/yyyy"), actual.ObservationDate, "ObservationDate"); Assert.AreEqual("decimal degrees", actual.OriginalCoordinateSystem, "OriginalCoordinateSystem"); Assert.AreEqual("Homayoun, T. Z. and R. B. Blair. 2009. Citizen-Science Monitoring of Landbirds in the Mississippi River Twin Cities Important Bird Area. Pages 607-616 in T.D., Rich, C. Arizmendi, D. Demarest and C. Thompson, editors. Tundra to Tropics: Connecting Birds, Habitats and People. Proceedings of the 4th International Partners in Flight Conference, 13-16 February 2008, McAllen, TX. Partners in Flight.", actual.ProtocolReference, "ProtocolReference"); Assert.AreEqual("Point Count", actual.ProtocolType, "ProtocolType"); Assert.AreEqual("http://www.partnersinflight.org/pubs/McAllenProc/articles/PIF09_Monitoring/Homayoun_PIF09.pdf", actual.ProtocolURL, "ProtocolURL"); Assert.AreEqual("Restricted", actual.RecordPermissions, "RecordPermissions"); Assert.AreEqual(locations[0].LocationId.ToString().ToUpper(), actual.RouteIdentifier, "RouteIdentifier"); Assert.AreEqual(PointSurveyGuid2.ToString().ToUpper(), actual.SamplingEventIdentifier, "SamplingEventIdentifier"); Assert.AreEqual(TestHelper.SPECIES_2_SCIENTIFIC, actual.ScientificName, "ScientificName"); Assert.AreEqual(TestHelper.SPECIES_2_CODE, actual.SpeciesCode, "SpeciesCode"); Assert.AreEqual(species, actual.SpecificEpithet, "SpecificEpithet"); Assert.AreEqual("Minnesota", actual.StateProvince, "StateProvince"); Assert.AreEqual(point.LocationId.ToString().ToUpper(), actual.SurveyAreaIdentifier, "SurveyAreaIdentifier"); Assert.AreEqual((surveyDate2.TimeOfDay.Hours + surveyDate2.TimeOfDay.Minutes / 60.0).ToString("00.00"), actual.TimeCollected.ToString("00.00"), "TimeCollected"); Assert.AreEqual((surveyDate.TimeOfDay.Hours + surveyDate.TimeOfDay.Minutes / 60.0).ToString("00.00"), actual.TimeObservationsEnded.ToString("00.00"), "TimeObservationsEnded"); Assert.AreEqual(surveyDate2.TimeOfDay.TotalHours.ToString("00.00"), actual.TimeObservationsStarted.ToString("00.00"), "TimeObservationsStarted"); Assert.AreEqual(startDate.Year.ToString(), actual.YearCollected.ToString(), "YearCollected"); } }