/* TEST CODE
* Prepare screen mirroring and check sink state.
*/
- _screenmirroring.Prepare(_displayOverlay, _resolution);
+ _screenmirroring.Prepare(new Display(CreateWindow()), _resolution);
Assert.IsTrue(_stateFlag, "State should be changed to prepared");
+
+ _screenmirroring.StateChanged -= _handlerState;
}
+
[Test]
[Category("P1")]
[Description("Test ScreenMirroring Prepare method and check event is invoked with proper state")]
/* TEST CODE
* Prepare screen mirroring and check sink state.
*/
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
Assert.IsTrue(_stateFlag, "State should be changed to prepared");
+
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
/* TEST CODE
* Prepare screen mirroring and check sink state.
*/
- _screenmirroring.Prepare(_displayOverlay);
+ _screenmirroring.Prepare(new Display(CreateWindow()));
Assert.IsTrue(_stateFlag, "State should be changed to prepared");
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
/* TEST CODE
* Prepare screen mirroring and check sink state.
*/
- _screenmirroring.Prepare(_displayEvas);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())));
Assert.IsTrue(_stateFlag, "State should be changed to prepared");
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
[Property("AUTHOR", "Hyunsop Park, hance.park@samsung.com")]
public void Prepare_CHECK_ARGUMENT_EXCEPTION()
{
-
_screenmirroring.StateChanged += _handlerState;
/* TEST CODE
_screenmirroring.Prepare(new Display(mediaView: null), (ScreenMirroringResolutions)(-1));
});
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
*/
Assert.Throws<ArgumentException>(delegate
{
- _screenmirroring.Prepare(_displayEvas, (ScreenMirroringResolutions)9999999);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), (ScreenMirroringResolutions)9999999);
});
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
/* TEST CODE
* Prepare screen mirroring and check sink state.
*/
- _screenmirroring.Prepare(_displayOverlay);
+ _screenmirroring.Prepare(new Display(CreateWindow()));
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
Assert.Throws<ObjectDisposedException>(delegate
{
- _screenmirroring.Prepare(_displayOverlay, _resolution);
+ _screenmirroring.Prepare(new Display(CreateWindow()), _resolution);
});
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
/* TEST CODE
* Prepare screen mirroring and check sink state.
*/
- _screenmirroring.Prepare(_displayOverlay);
+ _screenmirroring.Prepare(new Display(CreateWindow()));
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
Assert.Throws<ObjectDisposedException>(delegate
{
- _screenmirroring.Prepare(_displayOverlay);
+ _screenmirroring.Prepare(new Display(CreateWindow()));
});
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
_screenmirroring.Prepare(new Display(mediaView: null));
});
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
_screenmirroring.Prepare(new Display(window: (ElmSharp.Window)null));
});
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
{
try
{
-
/*
* TEST :
* Check if ConnectAsync(_ip, _port) api throws an exception
{
try
{
-
/*
* TEST :
* Check if ConnectAsync(_ip, _port) api throws an exception
Log.Info(LogTag, "ScreenMirroring Test gives an exception. msg : " + e.ToString());
Assert.IsInstanceOf<InvalidOperationException>(e);
}
+
}
[Test]
{
try
{
-
/*
* TEST :
* Check if ConnectAsync(_ip, _port) api throws an exception
{
try
{
-
/*
* TEST :
* Check if StartAsync api throws an exception
{
try
{
-
/*
* TEST :
* Check if PauseAsync api throws an exception
Log.Info(LogTag, "ScreenMirroring Test gives an exception. msg : " + e.ToString());
Assert.IsInstanceOf<InvalidOperationException>(e);
}
-
}
[Test]
{
try
{
-
/*
* TEST :
* Check if ResumeAsync api throws an exception
* TEST :
* Prepare with resolution and check if screen mirroring is not throwing exception.
*/
- _screenmirroring.Prepare(new Display(new MediaView(_window)), resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), resolution);
}
catch (Exception e)
{
* TEST :
* Prepare with resolution and check if screen mirroring is not throwing exception.
*/
- _screenmirroring.Prepare(new Display(new MediaView(_window)), resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), resolution);
}
catch (Exception e)
{
* TEST :
* Prepare with resolution and check if screen mirroring is not throwing exception.
*/
- _screenmirroring.Prepare(new Display(new MediaView(_window)), resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), resolution);
}
catch (Exception e)
{
* TEST :
* Prepare with resolution and check if screen mirroring is not throwing exception.
*/
- _screenmirroring.Prepare(new Display(new MediaView(_window)), resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), resolution);
}
catch (Exception e)
{
* TEST :
* Prepare with resolution and check if screen mirroring is not throwing exception.
*/
- _screenmirroring.Prepare(new Display(new MediaView(_window)), resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), resolution);
}
catch (Exception e)
{
* TEST :
* Prepare with resolution and check if screen mirroring is not throwing exception.
*/
- _screenmirroring.Prepare(new Display(new MediaView(_window)), resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), resolution);
}
catch (Exception e)
{
* TEST :
* Prepare with resolution and check if screen mirroring is not throwing exception.
*/
- _screenmirroring.Prepare(new Display(new MediaView(_window)), resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), resolution);
}
catch (Exception e)
{
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void Disconnect_CHECK_EXCEPTION()
{
-
/*
* TEST :
* Check if Disconect api throws an exception
{
_screenmirroring.Disconnect();
});
-
}
public void StateChangedIdle(object sender, ScreenMirroringStateChangedEventArgs e)
public async Task Unprepare_CHECK_STATE()
{
_screenmirroring.StateChanged += StateChangedIdle;
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
await Task.Delay(1000);
/* TEST CODE
_screenmirroring.Unprepare();
Assert.IsTrue(_stateFlag, "State should be changed to Null");
+ _screenmirroring.StateChanged -= StateChangedIdle;
}
[Test]
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void AudioInfo_READ_ONLY()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
/*
* TEST: Check if screenmirroring has AudioInfo object
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void VideoInfo_READ_ONLY()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
/*
* TEST: Check if screenmirroring has VideoInfo object
public async Task StateChanged_CHECK_EVENT()
{
_screenmirroring.StateChanged += _handlerState;
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
/*
* TEST:
await Task.Delay(1000);
Assert.True(_stateFlag, "State Changed event not triggered");
+ _screenmirroring.StateChanged -= _handlerState;
}
[Test]
public async Task ErrorOccurred_CHECK_EVENT()
{
var tcs = new TaskCompletionSource<bool>();
+ EventHandler<ScreenMirroringErrorOccurredEventArgs> checker = (s,e) => tcs.SetResult(true);
Log.Info(LogTag, "out_ErrorOccurred_CHECK_EVENT");
- _screenmirroring.ErrorOccurred += ((s, e) => tcs.SetResult(true));
- _screenmirroring.Prepare(_displayOverlay, _resolution);
+ _screenmirroring.ErrorOccurred += checker;
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
await _screenmirroring.ConnectAsync(_ip);
Assert.That(await tcs.Task, Is.True);
+
+ _screenmirroring.ErrorOccurred -= checker;
}
}
}
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void Codec_CHECK_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
var exception = Assert.Throws<InvalidOperationException>(() =>
{
ScreenMirroringAudioCodec result = _screenmirroring.AudioInfo.Codec;
public void Codec_CHECK_DISPOSE_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
var exception = Assert.Throws<ObjectDisposedException>(() =>
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void Channels_CHECK_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
var exception = Assert.Throws<InvalidOperationException>(() =>
{
int result = _screenmirroring.AudioInfo.Channels;
public void Channels_CHECK_DISPOSE_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
var exception = Assert.Throws<ObjectDisposedException>(() =>
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void SampleRate_CHECK_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
var exception = Assert.Throws<InvalidOperationException>(() =>
{
int result = _screenmirroring.AudioInfo.SampleRate;
public void SampleRate_CHECK_DISPOSE_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
var exception = Assert.Throws<ObjectDisposedException>(() =>
public void BitWidth_CHECK_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
var exception = Assert.Throws<InvalidOperationException>(() =>
{
int result = _screenmirroring.AudioInfo.BitWidth;
public void BitWidth_CHECK_DISPOSE_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
var exception = Assert.Throws<ObjectDisposedException>(() =>
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void Codec_CHECK_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
var exception = Assert.Throws<InvalidOperationException>(() =>
{
ScreenMirroringVideoCodec result = _screenmirroring.VideoInfo.Codec;
[Property("AUTHOR", "Hyunsoo Park, hance.park@samsung.com")]
public void Codec_CHECK_DISPOSE_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
var exception = Assert.Throws<ObjectDisposedException>(() =>
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void Resolution_CHECK_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
var exception = Assert.Throws<InvalidOperationException>(() =>
{
Size result = _screenmirroring.VideoInfo.Resolution;
[Property("AUTHOR", "Hyunsoo Park, hance.park@samsung.com")]
public void Resolution_CHECK_DISPOSE_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
var exception = Assert.Throws<ObjectDisposedException>(() =>
[Property("AUTHOR", "Gaurang Khanwalkar, g.khanwalkar@samsung.com")]
public void FrameRate_CHECK_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
var exception = Assert.Throws<InvalidOperationException>(() =>
{
int result = _screenmirroring.VideoInfo.FrameRate;
[Property("AUTHOR", "Hyunsoo Park, hance.park@samsung.com")]
public void FrameRate_CHECK_DISPOSE_EXCEPTION()
{
- _screenmirroring.Prepare(_displayEvas, _resolution);
+ _screenmirroring.Prepare(new Display(new MediaView(CreateWindow())), _resolution);
_screenmirroring.Unprepare();
_screenmirroring.Dispose();
var exception = Assert.Throws<ObjectDisposedException>(() =>