Beispiel #1
0
        public static MbUnitProject Load(string fileName)
        {
            if (fileName == null)
            {
                throw new ArgumentException("fileName is null.");
            }

            XmlSerializer ser = new XmlSerializer(typeof(MbUnitProject));

            using (StreamReader sr = new StreamReader(fileName))
            {
                MbUnitProject project = ser.Deserialize(sr) as MbUnitProject;
                return(project);
            }
        }
Beispiel #2
0
        public void SaveAndLoadTest()
        {
            // Save test project
            proj = new MbUnitProject();
            proj.Assemblies.Add("string1");
            proj.Assemblies.Add("string2");
            proj.Assemblies.Add("string3");
            proj.Save(filename);

            // Re-load project
            proj = MbUnitProject.Load(filename);
            Assert.AreEqual(3, proj.Assemblies.Count);
            CollectionAssert.Contains(proj.Assemblies, "string1");
            CollectionAssert.Contains(proj.Assemblies, "string2");
            CollectionAssert.Contains(proj.Assemblies, "string3");
        }
Beispiel #3
0
 public void SaveNullTest()
 {
     proj = new MbUnitProject();
     proj.Save(null);
 }
Beispiel #4
0
 public void LoadNullTest()
 {
     proj = MbUnitProject.Load(null);
 }
        public void SaveProject(string fileName)
        {
            MbUnitProject project = new MbUnitProject();
            foreach(TestDomain domain in this.TestDomains)
                project.Assemblies.Add(domain.TestFilePath);
            this.state.Save();
            project.TreeState = this.state.GetTreeViewState();

            project.Save(fileName);
        }