public void t_IncrementPointCounts_NullLists() { Guid pointSurveyId = TestHelper.TestGuid1; List <FiftyMeterDataEntry> entrylist = new List <FiftyMeterDataEntry>(); FiftyMeterDataEntryFactory.IncrementPointCounts <PointCountBeyond50>(pointSurveyId, entrylist, null); Assert.IsNotNull(entrylist, "entrylist is null"); Assert.AreEqual(0, entrylist.Count(), "entrylist does not contain zero objects"); }
public void t_IncrementPointCounts_Within50_3Entries() { Guid pointSurveyId = TestHelper.TestGuid1; string comments1 = "Comments"; string comments2 = string.Empty; List <FiftyMeterDataEntry> entryList = new List <FiftyMeterDataEntry>(); List <PointCountWithin50> countList = new List <PointCountWithin50>() { new PointCountWithin50() { Comments = comments1, EventId = pointSurveyId, SpeciesCode = TestHelper.SPECIES_1_CODE }, new PointCountWithin50() { Comments = comments1, EventId = pointSurveyId, SpeciesCode = TestHelper.SPECIES_1_CODE }, new PointCountWithin50() { Comments = comments2, EventId = pointSurveyId, SpeciesCode = TestHelper.SPECIES_2_CODE } }; // Exercising the system under test now... FiftyMeterDataEntryFactory.IncrementPointCounts <PointCountWithin50>(pointSurveyId, entryList, countList); // Validations -- the PointCountBeyond50 objects with same species code should be combined into // a single entry, and the third should be a second entry in the list. Assert.AreEqual(2, entryList.Count(), "entryList does not contain 2 entries"); ValidateFiftyMeterDataEntryObject(pointSurveyId, comments1, entryList, "1", 0, 2, TestHelper.SPECIES_1_CODE); ValidateFiftyMeterDataEntryObject(pointSurveyId, comments2, entryList, "2", 0, 1, TestHelper.SPECIES_2_CODE); }