예제 #1
0
        public void TestFieldVariable_Constructor()
        {
            var ws       = new Workspace();
            var fieldVar = new FieldVariable(null, "name1");

            Assert.AreEqual("name1", fieldVar.GetText());
            ws.Dispose();
        }
예제 #2
0
        public void TestFieldVariable_SetValueNoVariable()
        {
            Setup();

            var fieldVar = new FieldVariable(null, "name1");

            fieldVar.SetSourceBlock(MockBlock());

            fieldVar.SetValue("id1");
            Assert.AreEqual("id1", fieldVar.GetText());
            Assert.AreEqual("id1", fieldVar.GetRealValue());

            TearDown();
        }
예제 #3
0
        public void TestFieldVariable_SetValueMatchName()
        {
            Setup();

            workspace.CreateVariable("name2", null, "id2");
            var fieldVar = new FieldVariable(null, "name1");

            fieldVar.SetSourceBlock(MockBlock());

            fieldVar.SetValue("name2");
            Assert.AreEqual("name2", fieldVar.GetText());
            Assert.AreEqual("id2", fieldVar.GetRealValue());

            TearDown();
        }