Exemple #1
0
        public void ReportLogic()
        {
            Mock <IUnitOfWork>         uow          = new Mock <IUnitOfWork>();
            Mock <IReportRepository>   repo         = new Mock <IReportRepository>();
            Mock <IActivityRepository> activityRepo = new Mock <IActivityRepository>();
            Mock <IAccountRepository>  accountRepo  = new Mock <IAccountRepository>();

            ReportLogic logic = new ReportLogic(uow.Object, repo.Object, activityRepo.Object, accountRepo.Object);

            var report   = new Report();
            var sequence = new MockSequence();

            repo.InSequence(sequence).Setup(r => r.Create(report));
            repo.InSequence(sequence).Setup(r => r.Update(report));
            repo.InSequence(sequence).Setup(r => r.Get(report.Id));
            repo.InSequence(sequence).Setup(r => r.Delete(report.Id));
            logic.Create();
            logic.Update(report);
            logic.Get(report.Id);
            logic.Delete(report.Id);
        }