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

                FileInfo fileInfoRet = pfs.GetVariableFileInfo("FemEngineHD/DOMAIN", "file_name", 1);
                Assert.IsNotNull(fileInfoRet);
                Assert.AreEqual(fi.FullName.Replace("Gaspe.m21fm", "Gaspe.mesh"), fileInfoRet.FullName);
                Assert.AreEqual("", pfs.ErrorMessage);

                int?intRet = pfs.SetVariable <int>("FemEngineHD/DOMAIN", "file_name", 1, 1);
                Assert.IsNotNull(intRet);
                Assert.AreEqual(1, intRet);
                Assert.AreEqual("", pfs.ErrorMessage);

                FileInfo fileInfoRet2 = pfs.GetVariableFileInfo("FemEngineHD/DOMAIN", "file_name", 1);
                Assert.IsNull(fileInfoRet2);
                Assert.IsFalse(string.IsNullOrWhiteSpace(pfs.ErrorMessage));

                pfs.ErrorMessage = "";

                fileInfoRet2 = pfs.SetVariableFileInfo("FemEngineHD/DOMAIN", "file_name", 1, fileInfoRet);
                Assert.IsNotNull(fileInfoRet);
                Assert.AreEqual(fi.FullName.Replace("Gaspe.m21fm", "Gaspe.mesh"), fileInfoRet.FullName);
                Assert.AreEqual("", pfs.ErrorMessage);

                fileInfoRet = pfs.GetVariableFileInfo("FemEngineHD/DOMAIN", "file_name", 1);
                Assert.IsNotNull(fileInfoRet);
                Assert.AreEqual(fi.FullName.Replace("Gaspe.m21fm", "Gaspe.mesh"), fileInfoRet.FullName);
                Assert.AreEqual("", pfs.ErrorMessage);
            }
        }
Exemplo n.º 2
0
        public void PFS_GetVariable_FileInfo_Error()
        {
            using (PFS pfs = new PFS(fi))
            {
                Assert.IsNotNull(fi);
                Assert.IsTrue(fi.Exists);
                Assert.AreEqual(fileName, fi.FullName);

                FileInfo fileInfoRet = pfs.GetVariableFileInfo("FemEngineHD/DOMAIN", "file_nameNot", 1);
                Assert.IsNull(fileInfoRet);
                Assert.IsFalse(string.IsNullOrWhiteSpace(pfs.ErrorMessage));
            }
        }
Exemplo n.º 3
0
        public void PFS_GetVariable_FileInfo_OK()
        {
            using (PFS pfs = new PFS(fi))
            {
                Assert.IsNotNull(fi);
                Assert.IsTrue(fi.Exists);
                Assert.AreEqual(fileName, fi.FullName);

                FileInfo fileInfoRet = pfs.GetVariableFileInfo("FemEngineHD/DOMAIN", "file_name", 1);
                Assert.IsNotNull(fileInfoRet);
                Assert.AreEqual(fi.FullName.Replace("Gaspe.m21fm", "Gaspe.mesh"), fileInfoRet.FullName);
                Assert.AreEqual("", pfs.ErrorMessage);
            }
        }