示例#1
0
        public void RegisterModule(IPandaContainer container, PandaContainerContext context)
        {
            container
            .RequestRegistrationFor <IGetAllProjectsRequest>()
            .LatestRequest <GetAllProjectsRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <ICreateProjectCommand>()
            .LatestRequest <CreateProjectCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <IDeleteProjectCommand>()
            .LatestRequest <DeleteProjectCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetInformationOfRequest>()
            .LatestRequest <GetInformationOfRequest>()
            .Register(context);

            container.RegisterType <IGetInformationOfRequestAspect, GetInformationOfRequestAspect>();
            container.RegisterType <IGetAllProjectsParameterAspect, GetAllProjectsParameterAspect>();
            container.RegisterType <ICreateProjectCommandAspect, CreateProjectCommandAspect>();
            container.RegisterType <IProjectRequestBuilderFactory, ProjectRequestBuilderFactory>();
        }
示例#2
0
        public void RegisterModule(IPandaContainer container, PandaContainerContext context)
        {
            container
            .RequestRegistrationFor <IGetCurrentUserRequest>()
            .LatestRequest <GetCurrentUserRequest>()
            .Register(context);

            container.RegisterType <IUsersRequestBuilderFactory, UsersRequestBuilderFactory>();
        }
示例#3
0
        public void RegisterModule(IPandaContainer container, PandaContainerContext context)
        {
            container
            .RequestRegistrationFor <ISearchForPlansRequest>()
            .LatestRequest <SearchForPlansRequest>()
            .Register(context);

            container.RegisterType <IPlanSearchParameterAspect, PlanSearchParameterAspect>();

            container.RegisterType <ISearchRequestBuilderFactory, SearchRequestBuilderFactory>();
        }
示例#4
0
        public void RegisterModule(IPandaContainer container, PandaContainerContext context)
        {
            container
            .RequestRegistrationFor <IGetBuildsOfPlanRequest>()
            .LatestRequest <GetBuildsOfPlanRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetInformationOfBuildRequest>()
            .LatestRequest <GetInformationOfBuildRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetCommentsOfBuildRequest>()
            .LatestRequest <GetCommentsOfBuildRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IAddCommentToBuildCommand>()
            .LatestRequest <AddCommentToBuildCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetLabelsOfBuildRequest>()
            .LatestRequest <GetLabelsOfBuildRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IAddLabelToBuildCommand>()
            .LatestRequest <AddLabelToBuildCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <IDeleteLabelOfBuildCommand>()
            .LatestRequest <DeleteLabelOfBuildCommand>()
            .Register(context);

            container.RegisterType <IBuildStateParameterAspect, BuildStateParameterAspect>();
            container.RegisterType <ILabelFilterParameterAspect, LabelFilterParameterAspect>();
            container.RegisterType <IIssueFilterParameterAspect, IssueFilterParameterAspect>();
            container.RegisterType <IGetBuildsOfPlanParameterAspect, GetBuildsOfPlanParameterAspect>();
            container.RegisterType <IGetInformationOfBuildParameterAspect, GetInformationOfBuildParameterAspect>();
            container.RegisterType <IBuildRequestBuilderFactory, BuildRequestBuilderFactory>();
        }
        public void VersionSpecificRegistrationTest()
        {
            var containerMock = new Mock <IPandaContainer>();

            var registration = new RequestProviderRegistration <ITestRequest>(containerMock.Object)
                               .VersionSpecificRequest <TestRequestA>(new Version("1.0.1"))
                               .VersionSpecificRequest <TestRequestB>(new Version("1.1.1"))
                               .LatestRequest <TestRequestC>();

            var lowerVersion = new PandaContainerContext(new Version("1.0.0"));

            registration.Register(lowerVersion);

            containerMock.Verify(c => c.RegisterType <ITestRequest>(typeof(TestRequestA)));
            containerMock.VerifyNoOtherCalls();

            var middleVersion = new PandaContainerContext(new Version("1.0.6"));

            registration.Register(middleVersion);

            containerMock.Verify(c => c.RegisterType <ITestRequest>(typeof(TestRequestB)));
            containerMock.VerifyNoOtherCalls();

            var higherVersion = new PandaContainerContext(new Version("1.2.1"));

            registration.Register(higherVersion);

            containerMock.Verify(c => c.RegisterType <ITestRequest>(typeof(TestRequestC)));
            containerMock.VerifyNoOtherCalls();

            var matchedVersion = new PandaContainerContext(new Version("1.1.1"));

            registration.Register(matchedVersion);

            containerMock.Verify(c => c.RegisterType <ITestRequest>(typeof(TestRequestB)));
            containerMock.VerifyNoOtherCalls();
        }
示例#6
0
        public void RegisterModule(IPandaContainer container, PandaContainerContext context)
        {
            container
            .RequestRegistrationFor <IGetAllPlansRequest>()
            .LatestRequest <GetAllPlansRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetInformationOfPlanRequest>()
            .LatestRequest <GetInformationOfPlanRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetBranchesOfPlanRequest>()
            .LatestRequest <GetBranchesOfPlanRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetArtifactsOfPlanRequest>()
            .LatestRequest <GetArtifactsOfPlanRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IEnableDisablePlanCommand>()
            .LatestRequest <EnableDisablePlanCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <IDeletePlanCommand>()
            .LatestRequest <DeletePlanCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <ICreatePlanCommand>()
            .LatestRequest <CreatePlanCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetLabelsOfPlanRequest>()
            .LatestRequest <GetLabelsOfPlanRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IAddLabelToPlanCommand>()
            .LatestRequest <AddLabelToPlanCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <IDeleteLabelOfPlanCommand>()
            .LatestRequest <DeleteLabelOfPlanCommand>()
            .Register(context);

            container
            .RequestRegistrationFor <IGetVcsBranchesOfPlanRequest>()
            .LatestRequest <GetVcsBranchesOfPlanRequest>()
            .Register(context);

            container
            .RequestRegistrationFor <IFavouritePlanCommand>()
            .LatestRequest <FavouritePlanCommand>()
            .Register(context);

            container.RegisterType <IGetBranchesOfPlanParameterAspect, GetBranchesOfPlanParameterAspect>();
            container.RegisterType <ICreatePlanParameterAspect, CreatePlanParameterAspect>();
            container.RegisterType <IGetAllPlansParameterAspect, GetAllPlansParameterAspect>();
            container.RegisterType <IGetInformationOfPlanParameterAspect, GetInformationOfPlanParameterAspect>();

            container.RegisterType <IPlanRequestBuilderFactory, PlanRequestBuilderFactory>();
        }