Beispiel #1
0
        public void DisconnectTest()
        {
            var tokenSource = new CancellationTokenSource();
            var cameraMock  = new Mock <IExtendedCamera>();

            var streamingTest = new CameraStreamingState(cameraMock.Object, It.IsAny <IProxyFactory>(), tokenSource);

            streamingTest.Disconnect();

            cameraMock.VerifySet(x => x.StateObject = It.Is <ICameraState>(y => y.GetType() == typeof(CameraNotConnectedState)));
            Assert.AreEqual(true, tokenSource.IsCancellationRequested);
        }
Beispiel #2
0
        public void StartStreamingTest()
        {
            var streamingTest = new CameraStreamingState(It.IsAny <IExtendedCamera>(), It.IsAny <IProxyFactory>(), It.IsAny <CancellationTokenSource>());

            try
            {
                streamingTest.StartStreaming(It.IsAny <Profile>(), 10);
            }
            catch (Exception e)
            {
                Assert.AreEqual(typeof(IncorrectCameraStateException), e.GetType());
            }
        }