Exemplo n.º 1
0
        private VSOController CreateVSOController()
        {
            var fakeSourceRepositoryFactory = new SourceControlSync.Domain.Fakes.StubISourceRepositoryFactory()
            {
                CreateSourceRepositoryString = (connectionString) => { return(fakeSourceRepository); }
            };
            var fakeDestinationRepositoryFactory = new SourceControlSync.Domain.Fakes.StubIDestinationRepositoryFactory()
            {
                CreateDestinationRepositoryString = (connectionString) => { return(fakeDestinationRepository); }
            };
            var controller = new VSOController(
                fakeSourceRepositoryFactory,
                fakeDestinationRepositoryFactory,
                fakeChangesCalculator,
                fakeChangesReport,
                fakeErrorReport
                );

            controller.Request = new HttpRequestMessage(HttpMethod.Post, "");
            controller.Request.Headers.Add(VSOController.HEADER_SOURCE_CONNECTIONSTRING, "");
            controller.Request.Headers.Add(VSOController.HEADER_DESTINATION_CONNECTIONSTRING, "");
            controller.Request.Headers.Add(VSOController.HEADER_ROOT, "/");
            return(controller);
        }
 private VSOController CreateVSOController()
 {
     var fakeSourceRepositoryFactory = new SourceControlSync.Domain.Fakes.StubISourceRepositoryFactory()
     {
         CreateSourceRepositoryString = (connectionString) => { return fakeSourceRepository; }
     };
     var fakeDestinationRepositoryFactory = new SourceControlSync.Domain.Fakes.StubIDestinationRepositoryFactory()
     {
         CreateDestinationRepositoryString = (connectionString) => { return fakeDestinationRepository; }
     };
     var controller = new VSOController(
         fakeSourceRepositoryFactory,
         fakeDestinationRepositoryFactory,
         fakeChangesCalculator,
         fakeChangesReport,
         fakeErrorReport
         );
     controller.Request = new HttpRequestMessage(HttpMethod.Post, "");
     controller.Request.Headers.Add(VSOController.HEADER_SOURCE_CONNECTIONSTRING, "");
     controller.Request.Headers.Add(VSOController.HEADER_DESTINATION_CONNECTIONSTRING, "");
     controller.Request.Headers.Add(VSOController.HEADER_ROOT, "/");
     return controller;
 }