Пример #1
0
        private void Setup(string approach)
        {
            DatabaseTesting.ResetDatabase();
            Context context = new Context();

            switch (approach)
            {
            case "Code":
                CopyDa_Code    copDa_Code    = new CopyDa_Code();
                LoaningDa_Code loaningDaCode = new LoaningDa_Code();
                CopyDm_Code    copyDm_Code   = new CopyDm_Code(copDa_Code, loaningDaCode, context);
                _copyService = new CopyService(copyDm_Code);
                break;

            case "Database":
                CopyDa_Database    copyDa_Database   = new CopyDa_Database(context);
                LoaningDa_Database loaningDaDatabase = new LoaningDa_Database(context);
                CopyDm_Database    copyDm_Database   = new CopyDm_Database(copyDa_Database, loaningDaDatabase);
                _copyService = new CopyService(copyDm_Database);
                break;

            default:
                new NotImplementedException();
                break;
            }
        }
Пример #2
0
        private void Setup(string approach)
        {
            DatabaseTesting.ResetDatabase();
            Context context = new Context();

            switch (approach)
            {
            case "Code":
                MaterialDa_Code  materialDa_Code  = new MaterialDa_Code();
                LibraryDa_Code   libraryDa_Code   = new LibraryDa_Code();
                LibrarianDa_Code librarianDaCode  = new LibrarianDa_Code();
                CopyDa_Code      copyDa_Code      = new CopyDa_Code();
                LoaningDa_Code   loaningDaCode    = new LoaningDa_Code();
                MaterialDm_Code  materialsDm_Code = new MaterialDm_Code(materialDa_Code, libraryDa_Code, librarianDaCode, copyDa_Code, loaningDaCode, context);
                _materialService = new MaterialService(materialsDm_Code);
                break;

            case "Database":
                MaterialsDa_Database materialDa_Db  = new MaterialsDa_Database(context);
                MaterialsDm_Database materialsDm_Db = new MaterialsDm_Database(materialDa_Db);
                _materialService = new MaterialService(materialsDm_Db);
                break;

            default:
                new NotImplementedException();
                break;
            }
        }
Пример #3
0
        private void Setup(string approach)
        {
            DatabaseTesting.ResetDatabase();
            Context context = new Context();

            switch (approach)
            {
            case "Database":
                StatisticsDa_Database statisticsDa_Db = new StatisticsDa_Database(context);
                StatisticsDm_Database statisticsDm_Db = new StatisticsDm_Database(statisticsDa_Db);
                _statisticsService = new StatisticsService(statisticsDm_Db);
                break;

            default:
                new NotImplementedException();
                break;
            }
        }
Пример #4
0
        private void Setup(string approach)
        {
            DatabaseTesting.ResetDatabase();
            Context context = new Context();

            switch (approach)
            {
            case "Code":
                _loaningService = new LoaningService(new LoaningDm_Code(new LoaningDa_Code(), new MemberDa_Code(), context));
                break;

            case "Database":
                _loaningService = new LoaningService(new LoaningDm_Database(new LoaningDa_Database(context)));
                break;

            default:
                new NotImplementedException();
                break;
            }
        }