Exemplo n.º 1
0
 public void ShouldGetFactFromADataRow()
 {
     var datatable = Helper.GetStandardFactDataTable();
     datatable.Columns.Add(ConfigSettings.Id);
     var dataRow = datatable.NewRow();
     dataRow[ConfigSettings.Id] = 1;
     datatable.Rows.Add(dataRow);
     var result = Fact.GetFactFromRow(dataRow);
     var fact = new Fact {FactId = "1"};
     Assert.AreEqual(fact.FactId, result.FactId);
 }
        public void Init()
        {
            var dictionary = new Dictionary<string , IEnumerable<Fact>>();
            var fact1 = new Fact{FactId = "1"};
            var fact2 = new Fact{FactId = "2"};
            var fact3 = new Fact{FactId = "3"};
            var fact4 = new Fact{FactId = "4"};
            dictionary.Add("1" , new List<Fact>{fact2 , fact3});
            dictionary.Add("5" , new List<Fact>{fact4 , fact1});
            var parentList = ParentList.GetParentSet(dictionary);
            _parentList = parentList;

            var expected = new List<string>();
            var tree = "5   " + (char)26 + " 4  \n    "+(char)26 +" 1   " + (char)26 + " 2  \n          "+(char)26 + " 3  \n         ";

            expected.Add(tree);
            _expected = expected;
        }
        public void Init()
        {
            var map = new Dictionary<string, IEnumerable<Fact>>();
            var listFacts1 = new List<Fact>();
            var fact1 = new Fact { FactId = "2" };
            listFacts1.Add(fact1);

            var listFacts2 = new List<Fact>();
            var fact2 = new Fact { FactId = "3" };
            var fact3 = new Fact { FactId = "4" };
            listFacts2.Add(fact2);
            listFacts2.Add(fact3);

            var listFacts3 = new List<Fact>();
            var fact4 = new Fact { FactId = "5" };
            var fact5 = new Fact { FactId = "6" };
            listFacts3.Add(fact4);
            listFacts3.Add(fact5);

            map.Add("1", listFacts1);
            map.Add("2" , listFacts2);
            map.Add("3" , listFacts3);
            _list = ParentList.GetParentSet(map);
        }