Example #1
0
        public void SetUp()
        {
            _assemblyOutputDirectoy = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MixerTest");
            _modulePath             = Path.Combine(_assemblyOutputDirectoy, "Signed.dll");

            if (Directory.Exists(_assemblyOutputDirectoy))
            {
                Directory.Delete(_assemblyOutputDirectoy, true);
            }

            _mixedTypeFinderStub      = MockRepository.GenerateStub <IMixedTypeFinder> ();
            _mixerPipelineFactoryStub = MockRepository.GenerateStub <IMixerPipelineFactory> ();
            _pipelineStub             = MockRepository.GenerateStub <IPipeline> ();

            _mixer = new Mixer(_mixedTypeFinderStub, _mixerPipelineFactoryStub, _assemblyOutputDirectoy);

            _reflectionServiceDynamicMock = MockRepository.GenerateMock <IReflectionService>();
            _codeManagerDynamicMock       = MockRepository.GenerateMock <ICodeManager>();
            _pipelineStub.Stub(stub => stub.ReflectionService).Return(_reflectionServiceDynamicMock);
            _pipelineStub.Stub(stub => stub.CodeManager).Return(_codeManagerDynamicMock);

            _fakeMixedType = typeof(int);
            _configuration = new MixinConfiguration();

            _mixedTypeFinderStub.Stub(stub => stub.FindMixedTypes(_configuration)).Return(new[] { _fakeMixedType });

            _mixerPipelineFactoryStub.Stub(stub => stub.GetModulePaths(_assemblyOutputDirectoy)).Return(new[] { _modulePath });
            _mixerPipelineFactoryStub.Stub(stub => stub.CreatePipeline(_assemblyOutputDirectoy)).Return(_pipelineStub);
        }
 protected virtual IPipeline NewPipeline(
     PipelineSettings settings,
     ICodeManager codeManager,
     IReflectionService reflectionService,
     ITypeAssembler typeAssembler)
 {
     return(new Pipeline(settings, codeManager, reflectionService, typeAssembler));
 }
Example #3
0
        private void compileCode(string language, string code, string outFileName)
        {
            //
            //var dnh = new DotNetManagerFront();
            ICodeManager man = CodeManagerFactory.Instance.GetCodeManager();

            man.CompileToFile(language, code, outFileName);
        }
Example #4
0
 public CodeHistoryController(ICodeManager codeManager, IMapper mapper, UserManager <User> userManager, IExerciseManager exerciseManager, ICourseManager courseManager)
 {
     this.userManager     = userManager;
     this.codeManager     = codeManager;
     this.mapper          = mapper;
     this.exerciseManager = exerciseManager;
     this.courseManager   = courseManager;
 }
 public AdminPanelController(ICodeManager codeManager, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, IMapper mapper, IExerciseManager exerciseManager, ICourseManager courseManager)
 {
     this.userManager     = userManager;
     this.roleManager     = roleManager;
     this.codeManager     = codeManager;
     this.mapper          = mapper;
     this.exerciseManager = exerciseManager;
     this.courseManager   = courseManager;
 }
        public override void SetUp()
        {
            base.SetUp();

            var pipeline = CreatePipelineWithAdditionalTypeParticipant();

            _codeManager       = pipeline.CodeManager;
            _reflectionService = pipeline.ReflectionService;
        }
        public static void SeedOperators(IOperatorManager operatorManager, ICodeManager codeManager, ITariffManager tariffManager)
        {
            if (operatorManager.GetByName("Vodafone") == null)
            {
                OperatorViewModel oper1 = new OperatorViewModel();
                oper1.Name = "Vodafone";
                operatorManager.Add(oper1);
                oper1 = operatorManager.GetByName("Vodafone");

                CodeViewModel code1 = new CodeViewModel()
                {
                    OperatorId = oper1.Id, OperatorCode = "+38099"
                };
                CodeViewModel code2 = new CodeViewModel()
                {
                    OperatorId = oper1.Id, OperatorCode = "+38066"
                };
                CodeViewModel code3 = new CodeViewModel()
                {
                    OperatorId = oper1.Id, OperatorCode = "+38050"
                };

                codeManager.Add(code1);
                codeManager.Add(code2);
                codeManager.Add(code3);

                SeedTariffs(tariffManager, oper1.Id);
            }

            if (operatorManager.GetByName("Kyivstar") == null)
            {
                OperatorViewModel oper2 = new OperatorViewModel();
                oper2.Name = "Kyivstar";
                operatorManager.Add(oper2);
                oper2 = operatorManager.GetByName("Kyivstar");

                CodeViewModel code4 = new CodeViewModel()
                {
                    OperatorId = oper2.Id, OperatorCode = "+38097"
                };
                CodeViewModel code5 = new CodeViewModel()
                {
                    OperatorId = oper2.Id, OperatorCode = "+38067"
                };
                CodeViewModel code6 = new CodeViewModel()
                {
                    OperatorId = oper2.Id, OperatorCode = "+38096"
                };

                codeManager.Add(code4);
                codeManager.Add(code5);
                codeManager.Add(code6);

                SeedTariffs(tariffManager, oper2.Id);
            }
        }
Example #8
0
 public CommentApiController(IExerciseManager exerciseManager, ICourseManager courseManager,
                             UserManager <User> userManager, ICodeManager codeManager, IMapper mapper, ICommentManager commentManager)
 {
     this.exerciseManager = exerciseManager;
     this.courseManager   = courseManager;
     this.userManager     = userManager;
     this.commentManager  = commentManager;
     this.mapper          = mapper;
     this.codeManager     = codeManager;
 }
 public static void SeedData(UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager,
                             IOperatorManager operatorManager, ICodeManager codeManager, ITariffManager tariffManager,
                             IStopWordManager stopWordManager, IUnitOfWork unitOfWork)
 {
     SeedRoles(roleManager);
     SeedUsers(userManager);
     SeedOperators(operatorManager, codeManager, tariffManager);
     SeedStopWords(stopWordManager);
     SeedCampaigns(unitOfWork);
     SeedEmailCampaigns(unitOfWork);
 }
Example #10
0
 public ExerciseManagementController(IExerciseManager exerciseManager, ICourseManager courseManager,
                                     UserManager <User> userManager, ICodeManager codeManager, IMapper mapper, ICommentManager commentManager, IConfiguration configuration)
 {
     this.exerciseManager = exerciseManager;
     this.courseManager   = courseManager;
     this.userManager     = userManager;
     this.commentManager  = commentManager;
     this.configuration   = configuration;
     this.mapper          = mapper;
     this.codeManager     = codeManager;
 }
Example #11
0
        public void SetUp()
        {
            _settings              = PipelineSettings.New().Build();
            _codeManagerMock       = MockRepository.GenerateStrictMock <ICodeManager>();
            _reflectionServiceMock = MockRepository.GenerateStrictMock <IReflectionService>();
            _typeAssemblerMock     = MockRepository.GenerateStrictMock <ITypeAssembler>();

            _pipeline = new Pipeline(_settings, _codeManagerMock, _reflectionServiceMock, _typeAssemblerMock);

            _requestedType = ReflectionObjectMother.GetSomeType();
            _typeID        = AssembledTypeIDObjectMother.Create();
        }
Example #12
0
        private void executeCode(ServerConnectionSettings cn, string language, string code, string fileName)
        {
            //var dnh = new DotNetManagerFront();
            ICodeManager man = CodeManagerFactory.Instance.GetCodeManager();
            DataSet      ds  = man.CompileAndRun(language, code);

            if (ds != null)
            {
                var query = new Query(cn, cn.ServerName, cn.DatabaseName, code, ds.Tables[0]);
                _parentPresenter.OpenCode(query, fileName);
            }
        }
Example #13
0
        protected IPipeline CreatePipelineExactAssemblyLocation(string participantConfigurationID, PipelineSettings settings, params IParticipant[] participants)
        {
            // Avoid no-modification optimization.
            if (participants.Length == 0)
            {
                participants = new[] { CreateParticipant(CreateModifyingAction((id, ctx) => { })) }
            }
            ;

            var pipeline = new DefaultPipelineFactory().Create(participantConfigurationID, settings, participants);

            _codeManager = pipeline.CodeManager;

            return(pipeline);
        }
Example #14
0
        public Pipeline(
            PipelineSettings settings,
            ICodeManager codeManager,
            IReflectionService reflectionService,
            ITypeAssembler typeAssembler)
        {
            ArgumentUtility.CheckNotNull("settings", settings);
            ArgumentUtility.CheckNotNull("codeManager", codeManager);
            ArgumentUtility.CheckNotNull("reflectionService", reflectionService);
            ArgumentUtility.CheckNotNull("typeAssembler", typeAssembler);

            _settings          = settings;
            _codeManager       = codeManager;
            _reflectionService = reflectionService;
            _typeAssembler     = typeAssembler;
        }
Example #15
0
 /// <summary>
 /// 登录
 /// </summary>
 /// <param name="Accessor"></param>
 /// <param name="RedisService"></param>
 /// <param name="UserManager"></param>
 /// <param name="EmailService"></param>
 /// <param name="CodeManager"></param>
 /// <param name="Cms_SysconfigManager"></param>
 /// <param name="DbContext"></param>
 /// <param name="UserDetailsManager"></param>
 /// <param name="TokenService"></param>
 public LoginManager(IHttpContextAccessor Accessor,
                     IRedisService RedisService,
                     IUserManager UserManager,
                     IEmailService EmailService,
                     ICodeManager CodeManager,
                     ICms_SysconfigManager Cms_SysconfigManager,
                     DbContext DbContext,
                     IUserDetailsManager UserDetailsManager,
                     ITokenService TokenService)
 {
     this.Accessor             = Accessor;
     this.RedisService         = RedisService;
     this.UserManager          = UserManager;
     this.EmailService         = EmailService;
     this.CodeManager          = CodeManager;
     this.Cms_SysconfigManager = Cms_SysconfigManager;
     this.DbContext            = DbContext;
     this.UserDetailsManager   = UserDetailsManager;
     this.TokenService         = TokenService;
 }
Example #16
0
 public CodeController(ICodeManager codeManager, IOperatorManager operatorManager)
 {
     this.codeManager = codeManager;
 }
        public AssemblyTrackingCodeManager(ICodeManager codeManager)
        {
            ArgumentUtility.CheckNotNull("codeManager", codeManager);

            _codeManager = codeManager;
        }
Example #18
0
 protected override void Initialize()
 {
     manager = new CodeManager(mockUnitOfWork.Object, mockMapper.Object);
     TestContext.WriteLine("Overrided");
 }
Example #19
0
 public CodeAPIController(ICodeManager codeManager, IExerciseManager exerciseManager)
 {
     this.codeManager     = codeManager;
     this.exerciseManager = exerciseManager;
 }