Esempio n. 1
0
        public void PFS_GetVariable_DateTime_Exception_Error()
        {
            using (PFS pfs = new PFS(fi))
            {
                Assert.IsNotNull(fi);
                Assert.IsTrue(fi.Exists);
                Assert.AreEqual(fileName, fi.FullName);

                DateTime?dateTimeRet = pfs.GetVariableDateTime("FemEngineHD/TIME", "start_time");
                Assert.IsNotNull(dateTimeRet);
                Assert.AreEqual(new DateTime(2011, 1, 1, 0, 0, 0), dateTimeRet);
                Assert.AreEqual("", pfs.ErrorMessage);

                int value          = 300;
                int ParameterIndex = 6; // seconds
                int?intRet         = pfs.SetVariable <int>("FemEngineHD/TIME", "start_time", ParameterIndex, value);
                Assert.IsNotNull(intRet);

                dateTimeRet = pfs.GetVariableDateTime("FemEngineHD/TIME", "start_time");
                Assert.IsNull(dateTimeRet);
                Assert.IsFalse(string.IsNullOrWhiteSpace(pfs.ErrorMessage));

                pfs.ErrorMessage = "";

                value          = 0;
                ParameterIndex = 6; // seconds
                intRet         = pfs.SetVariable <int>("FemEngineHD/TIME", "start_time", ParameterIndex, value);
                Assert.IsNotNull(intRet);

                dateTimeRet = pfs.GetVariableDateTime("FemEngineHD/TIME", "start_time");
                Assert.IsNotNull(dateTimeRet);
                Assert.AreEqual(new DateTime(2011, 1, 1, 0, 0, 0), dateTimeRet);
                Assert.AreEqual("", pfs.ErrorMessage);
            }
        }
Esempio n. 2
0
        public void PFS_GetVariable_DateTime_CheckAll_Error()
        {
            using (PFS pfs = new PFS(fi))
            {
                Assert.IsNotNull(fi);
                Assert.IsTrue(fi.Exists);
                Assert.AreEqual(fileName, fi.FullName);

                DateTime?dateTimeRet = pfs.GetVariableDateTime("FemEngineHD/TIME", "start_timeNot");
                Assert.IsNull(dateTimeRet);
            }
        }
Esempio n. 3
0
        public void PFS_GetVariable_DateTime_OK()
        {
            using (PFS pfs = new PFS(fi))
            {
                Assert.IsNotNull(fi);
                Assert.IsTrue(fi.Exists);
                Assert.AreEqual(fileName, fi.FullName);

                DateTime?dateTimeRet = pfs.GetVariableDateTime("FemEngineHD/TIME", "start_time");
                Assert.IsNotNull(dateTimeRet);
                Assert.AreEqual(new DateTime(2011, 1, 1, 0, 0, 0), dateTimeRet);
                Assert.AreEqual("", pfs.ErrorMessage);
            }
        }