示例#1
0
        public void ApiGetActivityReports()
        {
            var acc = Mock.Of <IActivityReportService>(a => a.GetActivityReports() == _manyActivityReports);
            var uow = Mock.Of <IUnitOfWork>(u => u.ActivityReportService == acc);
            ActivityReportsController controller = new ActivityReportsController(uow);
            var activityReports = controller.GetActivityReports();

            Assert.IsTrue(activityReports.EqualValues(_manyActivityReports));
        }
示例#2
0
        public void ApiGetActivityReportById()
        {
            long id  = 15;
            var  acc = Mock.Of <IActivityReportService>(a => a.GetActivityReport(id) == _sampleActivityReport1);
            var  uow = Mock.Of <IUnitOfWork>(u => u.ActivityReportService == acc);
            ActivityReportsController controller = new ActivityReportsController(uow);
            var response       = controller.GetActivityReport(id);
            var result         = response as OkNegotiatedContentResult <ActivityReportDto>;
            var activityReport = result.Content;

            Assert.IsTrue(activityReport.EqualValues(_sampleActivityReport1));
        }