Beispiel #1
0
        public async Task Constructor_CameraTurnedOnThenTurnedOff_NewFrameNotFiredAfterOff()
        {
            bool       fired     = false;
            IWebCamera webCamera = new WebCamera(this.captureMock.Object);

            webCamera.NewFrame += (s, e) => { fired = true; };
            webCamera.On();
            fired = false;
            webCamera.Off();
            await Task.Delay(100);

            Assert.False(fired);
        }
Beispiel #2
0
        public async Task Constructor_CameraTurnedOnOffAndOnAgain_NewFrameFiredAgainAfterSecondOn()
        {
            bool       fired     = false;
            IWebCamera webCamera = new WebCamera(this.captureMock.Object);

            webCamera.NewFrame += (s, e) => { fired = true; };
            webCamera.On();
            webCamera.Off();
            webCamera.On();
            fired = false;
            await Task.Delay(100);

            Assert.True(fired);
        }