示例#1
0
        ///<summary>
        /// Used to deserialise a Xaml test case stored on disc into a TestCase
        ///</summary>
        ///<param name="filePath">The file path of the Xaml test case to deserialise.</param>
        ///<returns>The TestCase object</returns>
        public static TestCase LoadFromFile(string filePath)
        {
            string testCase;

            using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                var sr = new StreamReader(fs);
                testCase = sr.ReadToEnd();
            }
            return((TestCase)BizUnitSerializationHelper.Deserialize(testCase));
        }
示例#2
0
 ///<summary>
 /// Used to deserialise a Xaml test case into a TestCase
 ///</summary>
 ///<param name="xamlTestCase">The Xaml test case</param>
 ///<returns>The TestCase object</returns>
 ///<exception cref="NotImplementedException"></exception>
 public static TestCase LoadXaml(string xamlTestCase)
 {
     return((TestCase)BizUnitSerializationHelper.Deserialize(xamlTestCase));
 }
示例#3
0
 ///<summary>
 /// Used to save a TestCase to a string in Xaml format
 ///</summary>
 ///<param name="testCase">The TestCase to be saved to disc</param>
 ///<returns>The test case in Xaml format</returns>
 public static string Save(TestCase testCase)
 {
     return(BizUnitSerializationHelper.Serialize(testCase));
 }
示例#4
0
 ///<summary>
 /// Used to save a TestCase to disc in Xaml format
 ///</summary>
 ///<param name="testCase">The TestCase to be saved to disc</param>
 ///<param name="filePath">The file path of the Xaml test case representaiton.</param>
 public static void SaveToFile(TestCase testCase, string filePath, bool overwrite = false)
 {
     BizUnitSerializationHelper.SaveToFile(testCase, filePath, overwrite);
 }