public void ShouldGenerateHistogramReport()
 {
     userEventRepository.Setup(r => r.GetAll()).Returns(userEvents);
     var expectedHistogram = new Histogram();
     generateHistogram.Setup(g => g.Generate(userEvents)).Returns(new[] {expectedHistogram});
     histogramRepository.Setup(r => r.DeleteAll());
     histogramRepository.Setup(r => r.Add(expectedHistogram));
     featureRepository.Setup(r => r.GetAll()).Returns(new Feature[0]);
     controller.GenerateReport();
     generateHistogram.VerifyAll();
     histogramRepository.VerifyAll();
 }
 public Histogram Add(Histogram histogram)
 {
     context.Histograms.Add(histogram);
     context.SaveChanges();
     return histogram;
 }