本文整理汇总了C#中ProjectInfo.Save方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectInfo.Save方法的具体用法?C# ProjectInfo.Save怎么用?C# ProjectInfo.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectInfo
的用法示例。
在下文中一共展示了ProjectInfo.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectInfo_Serialization_InvalidFileName
public void ProjectInfo_Serialization_InvalidFileName()
{
// 0. Setup
ProjectInfo pi = new ProjectInfo();
// 1a. Missing file name - save
AssertException.Expects<ArgumentNullException>(() => pi.Save(null));
AssertException.Expects<ArgumentNullException>(() => pi.Save(string.Empty));
AssertException.Expects<ArgumentNullException>(() => pi.Save("\r\t "));
// 1b. Missing file name - load
AssertException.Expects<ArgumentNullException>(() => ProjectInfo.Load(null));
AssertException.Expects<ArgumentNullException>(() => ProjectInfo.Load(string.Empty));
AssertException.Expects<ArgumentNullException>(() => ProjectInfo.Load("\r\t "));
}
示例2: SaveAndReloadProjectInfo
private ProjectInfo SaveAndReloadProjectInfo(ProjectInfo original, string outputFileName)
{
Assert.IsFalse(File.Exists(outputFileName), "Test error: file should not exist at the start of the test. File: {0}", outputFileName);
original.Save(outputFileName);
Assert.IsTrue(File.Exists(outputFileName), "Failed to create the output file. File: {0}", outputFileName);
this.TestContext.AddResultFile(outputFileName);
ProjectInfo reloadedProjectInfo = ProjectInfo.Load(outputFileName);
Assert.IsNotNull(reloadedProjectInfo, "Reloaded project info should not be null");
ProjectInfoAssertions.AssertExpectedValues(original, reloadedProjectInfo);
return reloadedProjectInfo;
}