Esempio n. 1
0
        public void is_large_test_data_conflict_free()
        {
            const string fileName = @"..\..\..\..\..\test\sample-large.csv";

            var reportLoader = new ReportLoader.ReportLoader();

            var mappingResults = reportLoader.LoadReportData(fileName);

            var reportToModelConverter = new ReportToModelConverter();

            var installations = reportToModelConverter.ConvertReportData(mappingResults);


            var installationIndexMap = new InstallationIndexMap();
            // This is a variant catalog, where we index by ComputerID.
            var installationCatalog = new InstallationCatalogByComputer(installationIndexMap);


            installationCatalog.AddInstallationsByComputer(installations);

            foreach (var installationSet in installationIndexMap.Values)
            {
                // As the set contains only items with the same ComputerId, if we have multiple ComputerTypes, it's a concern.

                if (installationSet.Any())
                {
                    var firstComputerType = installationSet.First().ComputerType;

                    Assert.That(installationSet.Any(ii => ii.ComputerType != firstComputerType), Is.False);
                }
            }
        }
Esempio n. 2
0
        public void is_large_test_data_parsed_correctly()
        {
            const string fileName = @"..\..\..\..\..\test\sample-large.csv";

            var reportLoader = new ReportLoader.ReportLoader();

            var mappingResults = reportLoader.LoadReportData(fileName);

            Assert.That(mappingResults.Any(rr => !rr.IsValid), Is.False);
        }