public void AnalysisResultPostTest() { var shoppingProgramListViewModel = new ShoppingProgramListViewModel { ProgramList = new List <ShoppingProgram>() }; for (int i = 1; i < 20; i++) { shoppingProgramListViewModel.ProgramList.Add( new ShoppingProgram { AttributeValue = string.Format("Test{0}", i), PackageName = string.Format("PackageName{0}", i), ProgramName = string.Format("ProgramName{0}", i), TotalCount = i * 1111 }); } var analysisParameters = new OutputParametersViewModel { CommonResults = new CommonInputParameterViewModel { CurrencySymbol = "$", FileName = Path.Combine(EnvironmentSettings.GetInstance().DataUploadPath, CsvFileName) }, NightWatchmanResults = new NightWatchmanAnalysisResultsViewModel(), ShoppingResults = new ShoppingAnalysisViewModel(), ShoppingProgramListResults = shoppingProgramListViewModel }; var result = new SavingsAnalysisController().DownloadFile(analysisParameters); result = Path.Combine(EnvironmentSettings.GetInstance().OutputFolderPath, result); try { if (File.Exists(result)) { Assert.Pass("Report createded successfully "); } else { Assert.Fail("Report not created"); } } catch (SuccessException) { } }
public void AnalysisResultPostTest() { var shoppingProgramListViewModel = new ShoppingProgramListViewModel { ProgramList = new List<ShoppingProgram>() }; for (int i = 1; i < 20; i++) { shoppingProgramListViewModel.ProgramList.Add( new ShoppingProgram { AttributeValue = string.Format("Test{0}", i), PackageName = string.Format("PackageName{0}", i), ProgramName = string.Format("ProgramName{0}", i), TotalCount = i * 1111 }); } var analysisParameters = new OutputParametersViewModel { CommonResults = new CommonInputParameterViewModel { CurrencySymbol = "$", FileName = Path.Combine(EnvironmentSettings.GetInstance().DataUploadPath, CsvFileName) }, NightWatchmanResults = new NightWatchmanAnalysisResultsViewModel(), ShoppingResults = new ShoppingAnalysisViewModel(), ShoppingProgramListResults = shoppingProgramListViewModel }; var result = new SavingsAnalysisController().DownloadFile(analysisParameters); result = Path.Combine(EnvironmentSettings.GetInstance().OutputFolderPath, result); try { if (File.Exists(result)) { Assert.Pass("Report createded successfully "); } else { Assert.Fail("Report not created"); } } catch (SuccessException) { } }