Пример #1
0
        public void GetProjectPath_ProjectDoesnExists_ReturnsNull()
        {
            CreateXmlDoc();
            ConfigurationBase myXml  = new ConfigurationXmlFile(_doc);
            string            retVal = myXml.GetProjectPath("test");

            Assert.IsNull(retVal);
        }
Пример #2
0
        public void SaveProject_ProjectExists_ReturnsTrueAndChangeData()
        {
            CreateXmlDoc(3);
            ConfigurationBase myXml = new ConfigurationXmlFile(_doc);
            bool retVal             = myXml.SaveProject("Name1", "Fake");

            Assert.IsTrue(retVal);
            Assert.IsTrue(myXml.GetProjectPath("Name1").StartsWith(@"Fake"));
        }
Пример #3
0
        public void GetProjectPath_ProjectExists_ReturnsPath()
        {
            CreateXmlDoc(3);
            ConfigurationBase myXml  = new ConfigurationXmlFile(_doc);
            string            retVal = myXml.GetProjectPath("Name1");

            Assert.IsNotNull(retVal);
            Assert.IsTrue(retVal.StartsWith(@"C:\Windows\"));
        }
Пример #4
0
        public void RemoveProject_ProjectExists_ReturnsTrueAndWholeProjectIsRemoved()
        {
            CreateXmlDoc();
            ConfigurationBase myXml = new ConfigurationXmlFile(_doc);
            bool retVal             = myXml.RemoveProject("Name0");

            Assert.IsTrue(retVal);
            Assert.IsNull(myXml.GetProjectPath("Name0"));
        }
Пример #5
0
        public void GetProjectPath_EmptyConfigFile_ReturnsNull()
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<VBProjects></VBProjects>");
            ConfigurationBase myXml  = new ConfigurationXmlFile(doc);
            string            retVal = myXml.GetProjectPath("test");

            Assert.IsNull(retVal);
        }