public ShoppingAnalysisModel(ShoppingInputParameterViewModel shoppingInputModel, CommonInputParameterViewModel common)
 {
     this.shoppingInputModel = shoppingInputModel;
     this.connectionString =
         Repository.BuildConnectionString(
             EnvironmentSettings.GetInstance().DatabaseConnectionString,
             common.FileName.Replace(".zip", string.Empty));
 }
 public NightWatchmanAnalysisModel(
     NightWatchmanInputParameterViewModel nightWatchmanInputModel, CommonInputParameterViewModel common)
 {
     this.nightWatchmanInputModel = nightWatchmanInputModel;
     this.analysis = new NightWatchmanAnalysis
         {
             ConnectionString =
                 Repository.BuildConnectionString(
                     EnvironmentSettings.GetInstance().DatabaseConnectionString, 
                     common.FileName.Replace(".zip", string.Empty))
         };
 }
 public NightWatchmanAnalysisModel(
     NightWatchmanInputParameterViewModel nightWatchmanInputModel, CommonInputParameterViewModel common)
 {
     this.nightWatchmanInputModel = nightWatchmanInputModel;
     this.analysis = new NightWatchmanAnalysis
     {
         ConnectionString =
             Repository.BuildConnectionString(
                 EnvironmentSettings.GetInstance().DatabaseConnectionString,
                 common.FileName.Replace(".zip", string.Empty))
     };
 }
        public void AnalysisResultGetTest()
        {
            var commonResults = new CommonInputParameterViewModel
                { FileName = Path.Combine(EnvironmentSettings.GetInstance().DataUploadPath, CsvFileName) };

            var analysisParameters = new OutputParametersViewModel()
            {
                CommonResults = commonResults,

                NightWatchmanResults = new NightWatchmanAnalysisResultsViewModel(),
                ShoppingResults = new ShoppingAnalysisViewModel()
            };

            var result = new SavingsAnalysisController().AnalysisResults(analysisParameters) as ViewResult;
            Assert.AreEqual(Path.Combine(EnvironmentSettings.GetInstance().DataUploadPath, CsvFileName), result.ViewBag.SelectedFile);
        }
        public void AnalysisResultGetTest()
        {
            var commonResults = new CommonInputParameterViewModel
            {
                FileName = Path.Combine(EnvironmentSettings.GetInstance().DataUploadPath, CsvFileName)
            };

            var analysisParameters = new OutputParametersViewModel()
            {
                CommonResults = commonResults,

                NightWatchmanResults = new NightWatchmanAnalysisResultsViewModel(),
                ShoppingResults      = new ShoppingAnalysisViewModel()
            };

            var result = new SavingsAnalysisController().AnalysisResults(analysisParameters) as ViewResult;

            Assert.AreEqual(Path.Combine(EnvironmentSettings.GetInstance().DataUploadPath, CsvFileName), result.ViewBag.SelectedFile);
        }
 public ShoppingAnalysisModel(ShoppingInputParameterViewModel shoppingInputModel, CommonInputParameterViewModel common)
 {
     this.shoppingInputModel = shoppingInputModel;
     this.connectionString   =
         Repository.BuildConnectionString(
             EnvironmentSettings.GetInstance().DatabaseConnectionString,
             common.FileName.Replace(".zip", string.Empty));
 }