示例#1
0
 public void SetUp()
 {
     _autoSubstitute    = AutoSubstituteContainer.Create();
     _controller        = _autoSubstitute.GetController <DataDepositController>();
     _confirmController = _autoSubstitute.GetController <ConfirmController>();
     _projectController = _autoSubstitute.GetController <ProjectController>();
     _context           = _autoSubstitute.Resolve <ControllerContext>();
     _lookup            = _autoSubstitute.Resolve <ICurtinUserService>();
     _projectRepository = _autoSubstitute.Resolve <IProjectRepository>();
 }
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller = _autoSubstitute.GetController<DataDepositController>();
     _confirmController = _autoSubstitute.GetController<ConfirmController>();
     _projectController = _autoSubstitute.GetController<ProjectController>();
     _context = _autoSubstitute.Resolve<ControllerContext>();
     _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
     _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
 }
        public void SetUp()
        {
            _autoSubstitute = AutoSubstituteContainer.Create();
            _controller = _autoSubstitute.GetController<ProjectController>();
            _dmpController = _autoSubstitute.GetController<DmpController>();
            _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
            _context = _autoSubstitute.Resolve<ControllerContext>();
            _form = _context.HttpContext.Request.Form;
            _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
            _fieldOfResearchRepository = _autoSubstitute.Resolve<IFieldOfResearchRepository>();
            _socioEconomicObjectiveRepository = _autoSubstitute.Resolve<ISocioEconomicObjectiveRepository>();

            var appSettings = _autoSubstitute.Resolve<IAppSettingsService>();
            var dependencyResolver = _autoSubstitute.Resolve<IDependencyResolver>();
            DependencyResolver.SetResolver(dependencyResolver);
            dependencyResolver.GetService<IAppSettingsService>().Returns(appSettings);
        }
 public void Setup()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _fieldOfResearchRepository = _autoSubstitute.Resolve<IFieldOfResearchRepository>();
     _socioEconomicObjectiveRepository = _autoSubstitute.Resolve<ISocioEconomicObjectiveRepository>();
     _controller = _autoSubstitute.GetController<AjaxController>();
     _lookupService = _autoSubstitute.Resolve<ICurtinUserService>();
     _dataCollectionRepository = _autoSubstitute.Resolve<IDataCollectionRepository>();
 }
 public void Setup()
 {
     _autoSubstitute                   = AutoSubstituteContainer.Create();
     _fieldOfResearchRepository        = _autoSubstitute.Resolve <IFieldOfResearchRepository>();
     _socioEconomicObjectiveRepository = _autoSubstitute.Resolve <ISocioEconomicObjectiveRepository>();
     _controller               = _autoSubstitute.GetController <AjaxController>();
     _lookupService            = _autoSubstitute.Resolve <ICurtinUserService>();
     _dataCollectionRepository = _autoSubstitute.Resolve <IDataCollectionRepository>();
 }
        public void SetUp()
        {
            _autoSubstitute    = AutoSubstituteContainer.Create();
            _controller        = _autoSubstitute.GetController <ProjectController>();
            _dmpController     = _autoSubstitute.GetController <DmpController>();
            _projectRepository = _autoSubstitute.Resolve <IProjectRepository>();
            _context           = _autoSubstitute.Resolve <ControllerContext>();
            _form   = _context.HttpContext.Request.Form;
            _lookup = _autoSubstitute.Resolve <ICurtinUserService>();
            _fieldOfResearchRepository        = _autoSubstitute.Resolve <IFieldOfResearchRepository>();
            _socioEconomicObjectiveRepository = _autoSubstitute.Resolve <ISocioEconomicObjectiveRepository>();

            var appSettings        = _autoSubstitute.Resolve <IAppSettingsService>();
            var dependencyResolver = _autoSubstitute.Resolve <IDependencyResolver>();

            DependencyResolver.SetResolver(dependencyResolver);
            dependencyResolver.GetService <IAppSettingsService>().Returns(appSettings);
        }
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller = _autoSubstitute.GetController<DmpController>();
     _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
     _timerRepository = _autoSubstitute.Resolve<ITimerRepository>();
     _context = _autoSubstitute.Resolve<ControllerContext>();
     _form = _context.HttpContext.Request.Form;
     _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
 }
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller = _autoSubstitute.GetController<ApprovalController>();
     _dataCollectionRepository = _autoSubstitute.Resolve<IDataCollectionRepository>();
     _hashCodeRepository = _autoSubstitute.Resolve<IDataCollectionHashCodeRepository>();
     _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
     _bus = _autoSubstitute.Resolve<IBus>();
     _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
 }
 public void SetUp()
 {
     _autoSubstitute    = AutoSubstituteContainer.Create();
     _controller        = _autoSubstitute.GetController <DmpController>();
     _projectRepository = _autoSubstitute.Resolve <IProjectRepository>();
     _timerRepository   = _autoSubstitute.Resolve <ITimerRepository>();
     _context           = _autoSubstitute.Resolve <ControllerContext>();
     _form   = _context.HttpContext.Request.Form;
     _lookup = _autoSubstitute.Resolve <ICurtinUserService>();
 }
 public void Setup()
 {
     _autoSubstitute           = AutoSubstituteContainer.Create();
     _projectRepository        = _autoSubstitute.Resolve <IProjectRepository>();
     _dataCollectionRepository = _autoSubstitute.Resolve <IDataCollectionRepository>();
     _controller = _autoSubstitute.GetController <AdminController>();
     _context    = _autoSubstitute.Resolve <ControllerContext>();
     _form       = _context.HttpContext.Request.Form;
     _csvHelper  = _autoSubstitute.Resolve <ICsvHelper>();
 }
示例#11
0
 public void SetUp()
 {
     _autoSubstitute           = AutoSubstituteContainer.Create();
     _controller               = _autoSubstitute.GetController <ApprovalController>();
     _dataCollectionRepository = _autoSubstitute.Resolve <IDataCollectionRepository>();
     _hashCodeRepository       = _autoSubstitute.Resolve <IDataCollectionHashCodeRepository>();
     _lookup            = _autoSubstitute.Resolve <ICurtinUserService>();
     _bus               = _autoSubstitute.Resolve <IBus>();
     _projectRepository = _autoSubstitute.Resolve <IProjectRepository>();
 }
 public void Setup()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
     _dataCollectionRepository = _autoSubstitute.Resolve<IDataCollectionRepository>();
     _controller = _autoSubstitute.GetController<AdminController>();
     _context = _autoSubstitute.Resolve<ControllerContext>();
     _form = _context.HttpContext.Request.Form;
     _csvHelper = _autoSubstitute.Resolve<ICsvHelper>();
 }
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller = _autoSubstitute.GetController<DataCollectionController>();
     _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
     _dataCollectionRepository = _autoSubstitute.Resolve<IDataCollectionRepository>();
     _context = _autoSubstitute.Resolve<ControllerContext>();
     _form = _context.HttpContext.Request.Form;
     _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
     _fieldOfResearchRepository = _autoSubstitute.Resolve<IFieldOfResearchRepository>();
     _socioEconomicObjectiveRepository = _autoSubstitute.Resolve<ISocioEconomicObjectiveRepository>();
     _bus = _autoSubstitute.Resolve<IBus>();
 }
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller = _autoSubstitute.GetController<PageController>();
 }
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller     = _autoSubstitute.GetController <BaseController>();
     _lookup         = _autoSubstitute.Resolve <ICurtinUserService>();
 }
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller = _autoSubstitute.GetController<BaseController>();
     _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
 }
示例#17
0
 public void SetUp()
 {
     _autoSubstitute = AutoSubstituteContainer.Create();
     _controller     = _autoSubstitute.GetController <PageController>();
 }
        public void SetUp()
        {
            _autoSubstitute = AutoSubstituteContainer.Create();

            _projectRepository = _autoSubstitute.Resolve<IProjectRepository>();
            _dataCollectionRepository = _autoSubstitute.Resolve<IDataCollectionRepository>();
            _controller = _autoSubstitute.GetController<ConfirmController>();
            _lookup = _autoSubstitute.Resolve<ICurtinUserService>();
            var user = CreateUser("XX12345");
            var dmp = Builder<DataManagementPlan>.CreateNew()
                .With(o => o.NewDataDetail = Builder<NewDataDetail>.CreateNew().Build())
                .And(o => o.ExistingDataDetail = Builder<ExistingDataDetail>.CreateNew().Build())
                .And(o => o.DataSharing = Builder<DataSharing>.CreateNew().Build())
                .And(o => o.DataRelationshipDetail = Builder<DataRelationshipDetail>.CreateNew().Build())
                .Build();
            var dd = Builder<DataDeposit>.CreateNew().Build();
            _project = Builder<Project>.CreateNew()
                .With(o => o.DataManagementPlan = dmp)
                .And(o => o.DataDeposit = dd)
                .And(p => p.Description = "TestProject")
                .And(o => o.Keywords = "1,2,3,4,5,6,7,8,9,10,11,12")
                .Build();
            _project.FieldsOfResearch.AddRange(Builder<ProjectFieldOfResearch>
                                                   .CreateListOfSize(5)
                                                   .All()
                                                   .With(p => p.FieldOfResearch = Builder<FieldOfResearch>.CreateNew().Build())
                                                   .Build());
            _project.SocioEconomicObjectives.AddRange(Builder<ProjectSocioEconomicObjective>
                                                          .CreateListOfSize(7)
                                                          .All()
                                                          .With(p => p.SocioEconomicObjective = Builder<SocioEconomicObjective>.CreateNew().Build())
                                                          .Build());
            _project.Parties.AddRange(Builder<ProjectParty>.CreateListOfSize(8)
                                          .TheFirst(1)
                                          .With(o => o.Role = AccessRole.Members)
                                          .And(o => o.Party = Builder<Party>.CreateNew().With(p => p.Id = 0).Build())
                                          .TheNext(1)
                                          .With(o => o.Role = AccessRole.Owners)
                                          .And(o => o.Party = Builder<Party>.CreateNew().With(p => p.Id = 0).And(p => p.UserId = user.CurtinId).Build())
                                          .And(o => o.Relationship = ProjectRelationship.PrincipalInvestigator)
                                          .TheNext(1)
                                          .With(o => o.Role = AccessRole.Visitors)
                                          .And(o => o.Party = Builder<Party>.CreateNew().With(p => p.Id = 0).Build())
                                          .TheNext(1)
                                          .With(o => o.Role = AccessRole.None)
                                          .And(o => o.Party = Builder<Party>.CreateNew().With(p => p.Id = 0).Build())
                                          .TheNext(1)
                                          .With(o => o.Role = AccessRole.Members)
                                          .And(
                                              o =>
                                              o.Party =
                                              Builder<Party>.CreateNew().With(p => p.UserId = "FF24587").Build())
                                          .TheNext(1)
                                          .With(o => o.Role = AccessRole.Visitors)
                                          .And(
                                              o =>
                                              o.Party =
                                              Builder<Party>.CreateNew().With(p => p.UserId = "GA37493").Build())
                                          .TheNext(1)
                                          .With(o => o.Role = AccessRole.None)
                                          .And(
                                              o =>
                                              o.Party =
                                              Builder<Party>.CreateNew().With(p => p.UserId = "KK25344").Build())
                                          .TheNext(1)
                                          .With(o => o.Role = AccessRole.Owners)
                                          .And(
                                              o =>
                                              o.Party =
                                              Builder<Party>.CreateNew().With(p => p.UserId = "DD25265").Build())
                                          .Build());

            _bus = _autoSubstitute.Resolve<IBus>();
            _projectRepository.Get(Arg.Is(_project.Id)).Returns(_project);
            _projectRepository.GetByDataManagementPlanId(Arg.Is(_project.DataManagementPlan.Id)).Returns(_project);

            var resolver = Substitute.For<IDependencyResolver>();
            DependencyResolver.SetResolver(resolver);
        }
        public void SetUp()
        {
            _autoSubstitute = AutoSubstituteContainer.Create();

            _projectRepository        = _autoSubstitute.Resolve <IProjectRepository>();
            _dataCollectionRepository = _autoSubstitute.Resolve <IDataCollectionRepository>();
            _controller = _autoSubstitute.GetController <ConfirmController>();
            _lookup     = _autoSubstitute.Resolve <ICurtinUserService>();
            var user = CreateUser("XX12345");
            var dmp  = Builder <DataManagementPlan> .CreateNew()
                       .With(o => o.NewDataDetail         = Builder <NewDataDetail> .CreateNew().Build())
                       .And(o => o.ExistingDataDetail     = Builder <ExistingDataDetail> .CreateNew().Build())
                       .And(o => o.DataSharing            = Builder <DataSharing> .CreateNew().Build())
                       .And(o => o.DataRelationshipDetail = Builder <DataRelationshipDetail> .CreateNew().Build())
                       .Build();

            var dd = Builder <DataDeposit> .CreateNew().Build();

            _project = Builder <Project> .CreateNew()
                       .With(o => o.DataManagementPlan = dmp)
                       .And(o => o.DataDeposit         = dd)
                       .And(p => p.Description         = "TestProject")
                       .And(o => o.Keywords            = "1,2,3,4,5,6,7,8,9,10,11,12")
                       .Build();

            _project.FieldsOfResearch.AddRange(Builder <ProjectFieldOfResearch>
                                               .CreateListOfSize(5)
                                               .All()
                                               .With(p => p.FieldOfResearch = Builder <FieldOfResearch> .CreateNew().Build())
                                               .Build());
            _project.SocioEconomicObjectives.AddRange(Builder <ProjectSocioEconomicObjective>
                                                      .CreateListOfSize(7)
                                                      .All()
                                                      .With(p => p.SocioEconomicObjective = Builder <SocioEconomicObjective> .CreateNew().Build())
                                                      .Build());
            _project.Parties.AddRange(Builder <ProjectParty> .CreateListOfSize(8)
                                      .TheFirst(1)
                                      .With(o => o.Role = AccessRole.Members)
                                      .And(o => o.Party = Builder <Party> .CreateNew().With(p => p.Id = 0).Build())
                                      .TheNext(1)
                                      .With(o => o.Role        = AccessRole.Owners)
                                      .And(o => o.Party        = Builder <Party> .CreateNew().With(p => p.Id = 0).And(p => p.UserId = user.CurtinId).Build())
                                      .And(o => o.Relationship = ProjectRelationship.PrincipalInvestigator)
                                      .TheNext(1)
                                      .With(o => o.Role = AccessRole.Visitors)
                                      .And(o => o.Party = Builder <Party> .CreateNew().With(p => p.Id = 0).Build())
                                      .TheNext(1)
                                      .With(o => o.Role = AccessRole.None)
                                      .And(o => o.Party = Builder <Party> .CreateNew().With(p => p.Id = 0).Build())
                                      .TheNext(1)
                                      .With(o => o.Role = AccessRole.Members)
                                      .And(
                                          o =>
                                          o.Party =
                                              Builder <Party> .CreateNew().With(p => p.UserId = "FF24587").Build())
                                      .TheNext(1)
                                      .With(o => o.Role = AccessRole.Visitors)
                                      .And(
                                          o =>
                                          o.Party =
                                              Builder <Party> .CreateNew().With(p => p.UserId = "GA37493").Build())
                                      .TheNext(1)
                                      .With(o => o.Role = AccessRole.None)
                                      .And(
                                          o =>
                                          o.Party =
                                              Builder <Party> .CreateNew().With(p => p.UserId = "KK25344").Build())
                                      .TheNext(1)
                                      .With(o => o.Role = AccessRole.Owners)
                                      .And(
                                          o =>
                                          o.Party =
                                              Builder <Party> .CreateNew().With(p => p.UserId = "DD25265").Build())
                                      .Build());

            _bus = _autoSubstitute.Resolve <IBus>();
            _projectRepository.Get(Arg.Is(_project.Id)).Returns(_project);
            _projectRepository.GetByDataManagementPlanId(Arg.Is(_project.DataManagementPlan.Id)).Returns(_project);

            var resolver = Substitute.For <IDependencyResolver>();

            DependencyResolver.SetResolver(resolver);
        }