[Description("Testing ElmSharp.Image class")]
public class ImageTests
{
- private static int _mark;
- private static Image _image;
- private static MainWindow _window = MainWindow.GetInstance();
+ private int _mark;
+ private Image _image;
+ private MainWindow _window = MainWindow.GetInstance();
[SetUp]
- public static void Init()
+ public void Init()
{
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");
_image = new Image(_window);
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");
_image = null;
}
- private static void OnLoadingCompleted(object sender, EventArgs e)
+ private void OnLoadingCompleted(object sender, EventArgs e)
{
_mark = 1;
}
- private static void OnLoadingFailed(object sender, EventArgs e)
+ private void OnLoadingFailed(object sender, EventArgs e)
{
_mark = 1;
}
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")]
- public static async Task LoadingCompleted_CHECK()
+ public async Task LoadingCompleted_CHECK()
{
_mark = 0;
_image.LoadingCompleted += OnLoadingCompleted;
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "EVL")]
[Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")]
- public static async Task LoadingFailed_CHECK()
+ public async Task LoadingFailed_CHECK()
{
_mark = 0;
_image.LoadingFailed += OnLoadingFailed;
[Property("CRITERIA", "MR")]
[Precondition(1, "make sure the device can access to the internet")]
[Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")]
- public static async Task LoadAsync_Uri_CHECK()
+ public async Task LoadAsync_Uri_CHECK()
{
bool mark = await _image.LoadAsync("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg");
Assert.IsTrue(mark);
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")]
- public static async Task LoadAsync_File_CHECK()
+ public async Task LoadAsync_File_CHECK()
{
bool mark = await _image.LoadAsync(Program.Current.DirectoryInfo.Resource + "test.jpg");
Assert.IsTrue(mark, "LoadAsync method return true");
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Qian Sui, qian.sui@samsung.com")]
- public static async Task LoadAsync_Stream_CHECK()
+ public async Task LoadAsync_Stream_CHECK()
{
FileStream fs = new FileStream(Program.Current.DirectoryInfo.Resource + "test.jpg", FileMode.Open, FileAccess.Read);
bool mark = await _image.LoadAsync(fs);
Assert.IsNotNull(imageObj, "The image object of image widget shouldn't be null.");
}
}
-}
\ No newline at end of file
+}