using NUnit.Framework.TUnit;
using System;
using System.IO;
+using System.Linq;
namespace Tizen.Multimedia.Tests
{
public static void SetPrecondition()
{
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "[ENTER]");
+
string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
int index = 0;
+
+ if (string.IsNullOrWhiteSpace(result)) {
+ throw new InvalidOperationException("URI string of preconfigure.json is null or white space.");
+ }
+
string[] resultArray = StringParser(result);
if (resultArray == null)
// Remove backslash
resultArray[index + 1] = resultArray[index + 1].Replace("\\", "");
STREAMING_URI = resultArray[index + 1];
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, $"STREAMING_URI = {STREAMING_URI}");
break;
case "ADAPTIVE_STREAMING_URL":
resultArray[index + 1] = resultArray[index + 1].Replace("\\", "");
ADAPTIVE_STREAMING_URI = resultArray[index + 1];
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, $"ADAPTIVE_STREAMING_URI = {ADAPTIVE_STREAMING_URI}");
break;
default:
break;
}
index++;
}
+
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "[LEAVE]");
}
private static string ReadFile(string path)
}
finally
{
- if (reader != null)
- {
- reader.Dispose();
- }
+ reader?.Dispose();
}
return result;
}