Ejemplo n.º 1
0
        public void TestClear()
        {
            SavedSetting setting = SavedSetting.GetInstance();
            ExcelNode    enode   = new ExcelNode();

            setting.AddExcelNode(enode);
            TFSNode tnode = new TFSNode();

            setting.AddTFSNode(tnode);
            setting.Clear();
            Assert.AreEqual(0, setting.ExcelSize);
            Assert.AreEqual(0, setting.Size);
            Assert.AreEqual(0, setting.TFSSize);
        }
Ejemplo n.º 2
0
        public void TestAddTFSNode()
        {
            SavedSetting setting = SavedSetting.GetInstance();
            TFSNode      node    = new TFSNode()
            {
                LabelName = "1", FieldName = "2"
            };

            setting.Clear();
            Assert.IsTrue(setting.AddTFSNode(node));
            Assert.AreEqual(1, setting.TFSSize);
            Assert.AreEqual(1, setting.Size);
            Assert.AreEqual(0, setting.ExcelSize);
        }
Ejemplo n.º 3
0
        public void TestToString1Param()
        {
            TFSNode node = new TFSNode
            {
                FieldName = "FieldName",
            };
            String list = "";

            foreach (var s in node.DefaultOption)
            {
                list += $"{s}, ";
            }
            Assert.AreEqual(node.ToString(), $"Field=FieldName, LabelName=, " +
                            $"DefaultText=, DefaultOption=");
        }
Ejemplo n.º 4
0
        public void TestCheck(String s1, String s2, String s3, Boolean b4)
        {
            List <String> defaultOption3 = new List <string> {
                "Op1", "Op2", "Op3"
            };
            List <String> defaultOption0 = new List <string> {
            };
            TFSNode node = new TFSNode
            {
                FieldName     = s1,
                LabelName     = s2,
                DefaultText   = s3,
                DefaultOption = defaultOption3
            };

            Assert.AreEqual(b4, node.Check());
        }
Ejemplo n.º 5
0
        public void TestToString()
        {
            TFSNode node = new TFSNode
            {
                FieldName     = "FieldName",
                LabelName     = "LabelName",
                DefaultText   = "DefaultText",
                DefaultOption = new List <String> {
                    "Option1", "Option2", "Option3"
                }
            };
            String list = "";

            foreach (var s in node.DefaultOption)
            {
                list += $"{s}, ";
            }
            Assert.AreEqual(node.ToString(), $"Field=FieldName, LabelName=LabelName, " +
                            $"DefaultText=DefaultText, DefaultOption=Option1, Option2, Option3, ");
        }
Ejemplo n.º 6
0
        public void GetFieldName()
        {
            TFSNode node = new TFSNode
            {
                FieldName     = "FieldName",
                LabelName     = "LabelName",
                DefaultText   = "DefaultText",
                DefaultOption = new List <String> {
                    "Option1", "Option2", "Option3"
                }
            };

            Assert.AreEqual(node.FieldName, "FieldName");
            Assert.AreEqual(node.LabelName, "LabelName");
            Assert.AreEqual(node.DefaultText, "DefaultText");
            for (int i = 0; i < node.DefaultOption.Count; i++)
            {
                Assert.AreEqual(node.DefaultOption[i], $"Option{i + 1}");
            }
        }
Ejemplo n.º 7
0
        public void TestClearTFSNodesList()
        {
            SavedSetting setting = SavedSetting.GetInstance();

            setting.Clear();
            ExcelNode enode = new ExcelNode()
            {
                LabelName = "1", FieldName = "2", ColumnNum = 3
            };

            setting.AddExcelNode(enode);
            TFSNode tnode = new TFSNode()
            {
                LabelName = "1", FieldName = "2"
            };

            setting.AddTFSNode(tnode);
            setting.ClearTFSNodesList();
            Assert.AreEqual(1, setting.ExcelSize);
            Assert.AreEqual(1, setting.Size);
            Assert.AreEqual(0, setting.TFSSize);
        }