public void DatesToArrayShouldReturnListOfStrings(int density) { List <PredictionDate> expectedPredictionDate = new List <PredictionDate>(); expectedPredictionDate.Add(new PredictionDate() { Time = DateTime.Now }); expectedPredictionDate.Add(new PredictionDate() { Time = DateTime.MaxValue }); expectedPredictionDate.Add(new PredictionDate() { Time = DateTime.Today }); expectedPredictionDate.Add(new PredictionDate() { Time = DateTime.MinValue }); expectedPredictionDate.Add(new PredictionDate() { Time = DateTime.UtcNow }); List <ForecastEntity> expectedEntity = new List <ForecastEntity>(); foreach (var date in expectedPredictionDate) { expectedEntity.Add(new ForecastEntity() { PredictionDate = date }); } ModelsService models = new ModelsService(); //Act List <string> result = models.DatesToArray(expectedEntity, density); //Assert Assert.Equal(result.Count, expectedPredictionDate.Count / density); }