/// <summary> /// Reconstitutes the project file from the given path and populates the /// application with the referenced items. /// </summary> /// <param name="fileName">The path of the project containing the desired /// project.</param> private void LoadProjectFile(string fileName) { var serializer = new JesterProjectSerializer(); JesterProject project = serializer.Deserialize(fileName); targetAssemblyTreeView.LoadAssemblies(new[] { project.TargetAssemblyPath }); _shadowedTargetAssembly = Utilities.ShadowCopyAssembly(project.TargetAssemblyPath); _shadowedTestAssembly = Utilities.ShadowCopyAssembly(project.TestAssemblyPath); }
public void Can_save_project_to_disk() { JesterProject project = new JesterProject("targetAssembly.dll", "testAssembly.dll"); string savedFile = Path.GetTempFileName(); JesterProjectSerializer serializer = new JesterProjectSerializer(); serializer.Serialize(project, savedFile); FileAssert.Exists(savedFile); }
public void Can_reconstitute_a_saved_project_from_disk() { string sampleProjectFile = Utility.CopyToDisk(ExtractResourceAttribute.Stream); JesterProjectSerializer serializer = new JesterProjectSerializer(); JesterProject project = serializer.Deserialize(sampleProjectFile); Assert.AreEqual(Path.GetFileName(project.TargetAssemblyPath), "AnimalFarm.dll", "The expected value for the target assembly was not found."); Assert.AreEqual(Path.GetFileName(project.TestAssemblyPath), "AnimalFarm.Tests.dll", "The expected value for the test assembly was not found."); }
public void Can_reconstitute_a_saved_project_from_disk() { string sampleProjectFile = Utility.CopyToDisk(ExtractResourceAttribute.Stream); JesterProjectSerializer serializer = new JesterProjectSerializer(); JesterProject project = serializer.Deserialize(sampleProjectFile); Assert.AreEqual(Path.GetFileName(project.TargetAssemblyPath), "AnimalFarm.dll", "The expected value for the target assembly was not found."); Assert.AreEqual(Path.GetFileName(project.TestAssemblyPath), "AnimalFarm.Tests.dll", "The expected value for the test assembly was not found."); }
public void Can_save_project_to_disk() { JesterProject project = new JesterProject("targetAssembly.dll", "testAssembly.dll"); string savedFile = Path.GetTempFileName(); JesterProjectSerializer serializer = new JesterProjectSerializer(); serializer.Serialize(project, savedFile); FileAssert.Exists(savedFile); }
/// <summary> /// Reconstitutes the project file from the given path and populates the /// application with the referenced items. /// </summary> /// <param name="fileName">The path of the project containing the desired /// project.</param> private void LoadProjectFile(string fileName) { var serializer = new JesterProjectSerializer(); JesterProject project = serializer.Deserialize(fileName); targetAssemblyTreeView.LoadAssemblies(new[] {project.TargetAssemblyPath}); _shadowedTargetAssembly = Utilities.ShadowCopyAssembly(project.TargetAssemblyPath); _shadowedTestAssembly = Utilities.ShadowCopyAssembly(project.TestAssemblyPath); }
/// <summary> /// Handles the Click event of the okButton control. Sets the <see /// cref="ProjectFilePath"/> property to the location of the new <see /// cref="JesterProject"/> that the user has created. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the /// event data.</param> private void okButton_Click(object sender, EventArgs e) { JesterProject project = new JesterProject(targetAssemblyTextBox.Text, testAssemblyTextBox.Text); _projectFilePath = saveAsTextBox.Text; JesterProjectSerializer serializer = new JesterProjectSerializer(); serializer.Serialize(project, _projectFilePath); DialogResult = DialogResult.OK; Close(); }