Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 public Histogram Add(Histogram histogram)
 {
     context.Histograms.Add(histogram);
     context.SaveChanges();
     return histogram;
 }