示例#1
0
        public void RotatedImageProviderFlip()
        {
            var sourceImageProvider = SetUp.Get <IImageProvider>();

            var rotatedImageProvider = new RotatedImageProvider(sourceImageProvider, RotateFlipType.Rotate180FlipNone);

            var capture = rotatedImageProvider.Capture();

            Assert.AreEqual(sourceImageProvider.Width, capture.Width);
            Assert.AreEqual(sourceImageProvider.Width, rotatedImageProvider.Width);

            Assert.AreEqual(sourceImageProvider.Height, capture.Height);
            Assert.AreEqual(sourceImageProvider.Height, rotatedImageProvider.Height);
        }
示例#2
0
        public void ResizedImageProvider()
        {
            const int targetWidth  = 6,
                      targetHeight = 7;

            var resizedImageProvider = new ResizedImageProvider(SetUp.Get <IImageProvider>(), targetWidth, targetHeight, Color.Empty);

            var capture = resizedImageProvider.Capture();

            Assert.AreEqual(targetWidth, capture.Width);
            Assert.AreEqual(targetWidth, resizedImageProvider.Width);

            Assert.AreEqual(targetHeight, capture.Height);
            Assert.AreEqual(targetHeight, resizedImageProvider.Height);
        }
示例#3
0
        public void RecorderStates()
        {
            var recorder = new Recorder(SetUp.Get <IVideoFileWriter>(), SetUp.Get <IImageProvider>(), 10);

            Assert.AreEqual(recorder.State, RecorderState.Ready);

            recorder.Start();

            Assert.AreEqual(recorder.State, RecorderState.Recording);

            recorder.Pause();

            Assert.AreEqual(recorder.State, RecorderState.Paused);

            recorder.Start();

            Assert.AreEqual(recorder.State, RecorderState.Recording);

            recorder.Stop();

            Assert.AreEqual(recorder.State, RecorderState.Stopped);
        }
示例#4
0
 public void UnconstrainedGifEncoderNull()
 {
     new UnconstrainedFrameRateGifRecorder(null, SetUp.Get <IImageProvider>());
 }
示例#5
0
 public void RecorderImageProviderNull()
 {
     new Recorder(SetUp.Get <IVideoFileWriter>(), null, 10);
 }
示例#6
0
 public void RecorderVideoFileWriterNull()
 {
     new Recorder(null, SetUp.Get <IImageProvider>(), 10);
 }
示例#7
0
 public void AudioRecorderNullWriter()
 {
     new AudioRecorder(SetUp.Get <IAudioProvider>(), null);
 }
示例#8
0
 public void AudioRecorderNullProvider()
 {
     new AudioRecorder(null, SetUp.Get <IAudioFileWriter>());
 }