public void GivenValidData_WhenITryToHouseHold_HouseHoldInformationIsSaved()
        {
            _houseHoldingFileRepository.Setup(h => h.GetHouseHoldingData()).Returns(new HouseHoldingRunData
            {
                Grid = "grid",
                ProcessingGridRun = new Collection <string>()
                {
                    "grid1",
                    "grid2"
                },
                DocumentRunData = new Collection <DocumentRunData>
                {
                    new DocumentRunData
                    {
                        DocumentId    = Guid.NewGuid().ToString(),
                        HouseHoldDate = DateTime.Now
                    },
                    new DocumentRunData
                    {
                        DocumentId    = Guid.NewGuid().ToString(),
                        HouseHoldDate = DateTime.Now
                    }
                }
            });

            _documentService.Setup(c => c.GetDocument(It.IsAny <string>())).Returns(new Document());
            _gridRunService.Setup(g => g.GetGridRun(It.IsAny <string>())).Returns(new GridRun());

            _houseHoldingRunEngine.ProcessHouseHoldingRun();

            _houseHoldingRunRepository.Verify(x => x.Create(It.IsAny <HouseHoldingRun>()), Times.Once());
            _houseHoldRepository.Verify(x => x.Create(It.IsAny <HouseHold>()), Times.Exactly(2));
            _documentService.Verify(x => x.Update(It.IsAny <int>(), It.IsAny <int>()), Times.Exactly(2));
            _gridRunService.Verify(x => x.Update(It.IsAny <int>(), It.IsAny <DateTime?>(), It.IsAny <DateTime?>(), It.IsAny <int>(), It.IsAny <int?>(), It.IsAny <int>()), Times.Exactly(2));
        }
 public void ProcessHouseHoldingRun()
 {
     try
     {
         _houseHoldingRunEngine.ProcessHouseHoldingRun();
     }
     catch (Exception e)
     {
         throw new UnityException("Unable to process householding run", e);
     }
 }
Exemple #3
0
        public void Go()
        {
            NexdoxMessaging.StartEvent(this);
            Statics.Initialise(_engine, _appInfo);

            this.PerformIOC();

            _houseHoldingRunEngine.ProcessHouseHoldingRun();

            NexdoxMessaging.EndEvent(this);
        }