public void Setup()
        {

            Test.Initialize();


            _now = DateTime.Now;

            _submitForApprovalMessage = new SubmitForApproval
                        {
                            ApprovedBy = "GH13579",
                            ApprovedOn = _now,
                            DataCollectionId = 1
                        };

            _submitForSecondaryApprovalMessage = new SubmitForSecondaryApproval
                        {
                            DataCollectionId = 1,
                            ApprovedBy = "FH13545",
                            ApprovedOn = _submitForApprovalMessage.ApprovedOn.AddDays(1)
                        };

            _submitForFinalApprovalMessage = new SubmitForFinalApproval
                        {
                            DataCollectionId = 1,
                            ApprovedBy = "787878r",
                            ApprovedOn = _submitForSecondaryApprovalMessage.ApprovedOn.AddDays(1)
                        };

            _submitForSecondaryReApprovalMessage = new SubmitForSecondaryReApproval
            {
                DataCollectionId = 1,
                ApprovedBy = "454545k",
                ApprovedOn = _submitForFinalApprovalMessage.ApprovedOn.AddDays(1)
            };


            _publishDataCollectionMessage = new PublishDataCollection
                                                {
                                                    DataCollectionId = 1,
                                                    ApprovedBy = "321312w",
                                                    ApprovedOn = _submitForFinalApprovalMessage.ApprovedOn.AddDays(2)
                                                };

            _exportToVivoResponse = new ExportToVivoResponse
                                        {
                                            DataCollectionId = 1
                                        };

        }
        public void Send_submit_for_approval_command_to_bus(SourceProjectType projectType)
        {
            DataDeposit dd = projectType == SourceProjectType.DEPOSIT ? Builder<DataDeposit>.CreateNew().Build() : null;
            DataManagementPlan dmp = projectType == SourceProjectType.DMP ? Builder<DataManagementPlan>.CreateNew().Build() : null;
            
            var project = SetUpFullProjectWithAuthentication();
            project.SourceProjectType = projectType;
            project.DataDeposit = dd;
            project.DataManagementPlan = dmp;
            var collections = SetUpFullDataCollections(project, 2).ToList();
            collections.ForEach(o => o.CurrentState = new DataCollectionState(DataCollectionStatus.Submitted, DateTime.Now));
            // Arrange
            var vm = Builder<DataCollectionListViewModel>
                .CreateNew()
                .With(o => o.ProjectId = project.Id)
                .And(o => o.DataCollectionItems = Builder<DataCollectionItemViewModel>.CreateListOfSize(3).Build())
                .Build();

            var collection = collections[1];
            

            _bus.When(c => c.Send(Arg.Any<Action<SubmitForApproval>>())).Do(a =>
            {
                // Trace.WriteLine("Collection Id: " + collection.Id);

                // Arrange
                var rsc = new SubmitForApproval();
                var lambda = a.Arg<Action<SubmitForApproval>>();

                // Act
                lambda(rsc);

                Trace.WriteLine("Collection Id: " + collection.Id + " rsc: " + rsc.DataCollectionId);


                // Assert
                Assert.That(rsc.DataCollectionId, Is.EqualTo(collection.Id), "Invalid collection id passed to the bus");
                Assert.That(rsc.ApprovedOn, Is.EqualTo(collection.CurrentState.StateChangedOn).Within(1).Minutes, "Invalid submission date passed to the bus");
                Assert.That(rsc.ApprovedBy, Is.EqualTo(collection.Parties.Single(o => o.Relationship == DataCollectionRelationshipType.Manager).Party.UserId), "Invalid manager id passed to the bus");
            });

            // Act
            _projectRepository.Get(vm.ProjectId).Returns(project);
            _dataCollectionRepository.Get(collections[0].Id).Returns(collections[0]);
            _dataCollectionRepository.Get(collections[1].Id).Returns(collections[1]);

            // Assert
            _controller.WithCallTo(c => c.Index(vm)).ShouldRenderView("Submitted").WithModel<SubmittedDataCollectionsViewModel>((m =>
            {
                Assert.That(ModelCollectionIsEqualTo(vm, m));
                return true;
            }));
            _bus.Received().Send(Arg.Any<Action<SubmitForApproval>>());
        }