public void GenerateReportTypeB() { Area oneArea = new Area() { Name = "Limpieza" }; Topic oneTopic = new Topic() { Name = "Limpieza Ciudad", Area = oneArea }; Type oneType = new Type() { Name = "Liempieza Calle", Topic = oneTopic, CreationDate = DateTime.Now }; Type anotherType = new Type() { Name = "Liempieza Cuadra", Topic = oneTopic, CreationDate = DateTime.Now.AddDays(-3) }; Type anotherType2 = new Type() { Name = "Liempieza Barrio", Topic = oneTopic, CreationDate = DateTime.Now.AddDays(-2) }; Request req1 = new Request() { RequestNumber = 1, CreationDate = DateTime.Now, Email = "*****@*****.**", Status = Status.Creada, Type = oneType }; Request req2 = new Request() { Email = "*****@*****.**", RequestNumber = 2, Status = Status.Creada, Type = oneType }; Request req3 = new Request() { Email = "*****@*****.**", RequestNumber = 3, Status = Status.Aceptada, Type = anotherType }; Request req4 = new Request() { Email = "*****@*****.**", RequestNumber = 4, Status = Status.Aceptada, Type = anotherType2 }; ReportTypeBElement repBElem1 = new ReportTypeBElement() { Amount = 2, Type = oneType, }; ReportTypeBElement repBElem2 = new ReportTypeBElement() { Amount = 1, Type = anotherType, }; ReportTypeBElement repBElem3 = new ReportTypeBElement() { Amount = 1, Type = anotherType2, }; List <Request> requests = new List <Request>(); requests.Add(req1); requests.Add(req2); requests.Add(req3); requests.Add(req4); List <ReportTypeBElement> report = new List <ReportTypeBElement>(); report.Add(repBElem1); report.Add(repBElem2); report.Add(repBElem3); var reqRepoMock = new Mock <IRequestRepository>(MockBehavior.Strict); var adminRepoMock = new Mock <IRepository <Admin> >(MockBehavior.Strict); reqRepoMock.Setup(m => m.GetAllByCondition(It.IsAny <Expression <Func <Request, bool> > >())).Returns(requests); var adminLogic = new AdminLogic(adminRepoMock.Object, reqRepoMock.Object); List <ReportTypeBElement> reportGenerated = (List <ReportTypeBElement>)adminLogic.GenerateReportB(DateTime.Now.AddDays(-1), DateTime.Now.AddDays(+1)); reqRepoMock.VerifyAll(); Assert.IsTrue(report.SequenceEqual(reportGenerated)); }