Пример #1
0
        public void NullFilenameThrows()
        {
            var project = new XunitProject();

            project.AddAssembly(new XunitProjectAssembly {
                AssemblyFilename = "foo"
            });

            Assert.Throws <ArgumentNullException>(() => project.SaveAs(null));
        }
Пример #2
0
        public void ProjectIsMarkedCleanWhenSaved()
        {
            using (var tempFile = new TempFile())
            {
                var project  = new XunitProject();
                var assembly = new XunitProjectAssembly {
                    AssemblyFilename = @"C:\FooBar"
                };
                project.AddAssembly(assembly);

                project.SaveAs(tempFile.Filename);

                Assert.False(project.IsDirty);
            }
        }
Пример #3
0
        public void FilenameIsUpdated()
        {
            using (var tempFile = new TempFile())
            {
                var project  = new XunitProject();
                var assembly = new XunitProjectAssembly {
                    AssemblyFilename = @"C:\FooBar"
                };
                project.AddAssembly(assembly);

                project.SaveAs(tempFile.Filename);

                Assert.Equal(tempFile.Filename, project.Filename);
            }
        }
Пример #4
0
        void SaveProject(string filename)
        {
            try
            {
                project.SaveAs(filename);
                mruProjectList.Add(filename);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error loading project:\r\n\r\n" + ex.Message, windowTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            UpdateProjectDynamicMenus();
            UpdateRunState();
        }