コード例 #1
0
        private static void ExecuteConversion(ExcelRowsWithDependencies excel)
        {
            ExcelRowsConverterToGraphViz convertor = new ExcelRowsConverterToGraphViz();
            DotGraph graph       = convertor.Convert(excel).GeneratedGraph;
            string   graphInText = graph.Compile();

            File.WriteAllText(@"C:\dev\examples\ProjectDependencyGraph\UnitTestProject1\bin\Debug\ConvertToGraphViz1.dot", graphInText);
        }
コード例 #2
0
        public void Load_Basic_Success()
        {
            StructureOfExcelFile testFileStructure = new StructureOfExcelFile("Work Items", 1, 7, 2, "4,3,2", 6);
            var er = new ExcelReader(testFileStructure, @".\LoadMe1.xlsx");
            ExcelRowsWithDependencies rows = er.Load().LoadedExcel;

            Assert.IsNotNull(rows);
            Assert.IsTrue(rows.Any());
        }
コード例 #3
0
        private static ExcelRowsWithDependencies CreateBasicExcel()
        {
            ExcelRowsWithDependencies excel = new ExcelRowsWithDependencies(new ExcelRow[]
            {
                new ExcelRow(1, "1", null, 0),
                new ExcelRow(2, "2", "1", 0),
                new ExcelRow(3, "3", "1", 0),
            });

            return(excel);
        }
コード例 #4
0
        internal static ExcelRowsWithDependencies CreateExcelWithParentsDefinedLater()
        {
            ExcelRowsWithDependencies excel = new ExcelRowsWithDependencies(new ExcelRow[]
            {
                new ExcelRow(1, "1", null, 0),
                new ExcelRow(2, "2", "3", 0),
                new ExcelRow(3, "3", "1", 0),
            });

            return(excel);
        }
コード例 #5
0
        public void Sort_Basic_SortedCorrectly()
        {
            ExcelRowsWithDependencies excelRows = ExcelRowsForTests.CreateExcelWithParentsDefinedLater();
            int i = 0;

            int[] expectedOrder = { 1, 3, 2 };
            foreach (ExcelRow row in excelRows)
            {
                Assert.AreEqual(expectedOrder[i], row.Key);
                i++;
            }
        }
コード例 #6
0
        private static ExcelRowsWithDependencies CreateExcelWithParallelFlows()
        {
            ExcelRowsWithDependencies excel = new ExcelRowsWithDependencies(new ExcelRow[]
            {
                new ExcelRow(1, "1", null, 0),
                new ExcelRow(2, "2", "1", 0),
                new ExcelRow(3, "3", "1", 0),

                new ExcelRow(4, "4", null, 0),
                new ExcelRow(5, "5", "4", 0),
                new ExcelRow(6, "6", "4", 0),

                new ExcelRow(7, "7", "4,1", 0),
            });

            return(excel);
        }
コード例 #7
0
        public void Sort_ParentsCombination_SortedCorrectly()
        {
            /*
             *  new ExcelRow(1, "1", null),
             *  new ExcelRow(2, "2", "3,6"),
             *  new ExcelRow(7, "7", "2"),
             *  new ExcelRow(3, "3", "1"),
             *  new ExcelRow(6, "6", null),
             */
            ExcelRowsWithDependencies excelRows = ExcelRowsForTests.CreateExcelWithMoreAdvancedParentsDefinedLater();
            int i = 0;

            int[] expectedOrder = { 1, 3, 6, 2, 7 };
            foreach (ExcelRow row in excelRows)
            {
                Assert.AreEqual(expectedOrder[i], row.Key);
                i++;
            }
        }
コード例 #8
0
        private static (DotGraph GeneratedGraph, string ConversionErrors) ConvertToGraph(ExcelRowsWithDependencies excel)
        {
            ExcelRowsConverterToGraphViz convertor = new ExcelRowsConverterToGraphViz();

            return(convertor.Convert(excel));
        }
コード例 #9
0
        public void ConvertToGraphViz_NoAllParerntsDefined_ConvertedByThrows()
        {
            ExcelRowsWithDependencies excel = CreateExcelNotAllParentsDefined();

            ExecuteConversion(excel);
        }
コード例 #10
0
        public void ConvertToGraphViz_ParerntsDefinedLaterMoreAdvanced_Success()
        {
            ExcelRowsWithDependencies excel = ExcelRowsForTests.CreateExcelWithMoreAdvancedParentsDefinedLater();

            ExecuteConversion(excel);
        }
コード例 #11
0
        public void ConvertToGraphViz_ParallelFlows_Success()
        {
            ExcelRowsWithDependencies excel = CreateExcelWithParallelFlows();

            ExecuteConversion(excel);
        }
コード例 #12
0
        public void ConvertToGraphViz_Basic_Success()
        {
            ExcelRowsWithDependencies excel = CreateBasicExcel();

            ExecuteConversion(excel);
        }