Exemplo n.º 1
0
        public void DeleteSequenceDuringPause_NextItemSelected()
        {
            var seq = new CaptureSequence()
            {
                ProgressExposureCount = 0, TotalExposureCount = 5
            };
            var seq2 = new CaptureSequence()
            {
                TotalExposureCount = 10
            };

            var l = new CaptureSequenceList();

            l.Add(seq);

            l.Next();
            l.Next();
            l.Next();

            l.RemoveAt(l.ActiveSequenceIndex - 1);

            l.Add(seq2);

            Assert.AreEqual(seq2, l.ActiveSequence);
        }
Exemplo n.º 2
0
        public void DisableSequenceDuringPause_ModeRotate_NextItemSelected()
        {
            var seq = new CaptureSequence()
            {
                ProgressExposureCount = 0, TotalExposureCount = 5
            };
            var seq2 = new CaptureSequence()
            {
                TotalExposureCount = 10
            };

            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.ROTATE;
            l.Add(seq);

            l.Next();
            l.Next();
            l.Next();

            l.Items[l.ActiveSequenceIndex - 1].Enabled = false;

            l.Add(seq2);

            Assert.AreEqual(seq2, l.ActiveSequence);
        }
Exemplo n.º 3
0
        public void GetNextSequence_ModeRotate_NextSequenceSelected()
        {
            //Arrange
            var seq = new CaptureSequence()
            {
                TotalExposureCount = 5
            };
            var seq2 = new CaptureSequence()
            {
                TotalExposureCount = 5
            };
            var seq3 = new CaptureSequence()
            {
                TotalExposureCount = 5
            };
            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.ROTATE;

            l.Add(seq);
            l.Add(seq2);
            l.Add(seq3);

            //Act
            var actualFirst  = l.Next();
            var actualSecond = l.Next();
            var actualThird  = l.Next();
            var actualFourth = l.Next();

            //Assert
            Assert.AreSame(seq, actualFirst, "First wrong");
            Assert.AreSame(seq2, actualSecond, "Second wrong");
            Assert.AreSame(seq3, actualThird, "Third wrong");
            Assert.AreSame(seq, actualFourth, "Fourth wrong");
        }
Exemplo n.º 4
0
        public void GetNextSequence_ModeStandardOneDisabled_NextSequenceSelectedShouldBeEmpty()
        {
            //Arrange
            var seq = new CaptureSequence()
            {
                TotalExposureCount = 2
            };
            var seq2 = new CaptureSequence()
            {
                Enabled = false
            };
            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.STANDARD;
            l.Add(seq);
            l.Add(seq2);

            //Act
            var nextSeq = l.Next();

            nextSeq = l.Next();
            nextSeq = l.Next();

            //Assert
            Assert.AreEqual(string.Empty, l.TargetName, "Targetname");
            Assert.AreSame(null, nextSeq);
            Assert.AreEqual(1, l.Count);
            Assert.AreSame(null, l.ActiveSequence);
            Assert.AreEqual(-1, l.ActiveSequenceIndex);
            Assert.AreEqual(0, l.Delay);
        }
Exemplo n.º 5
0
        public void GetNextSequence_ModeStandardOneDisabled_Initial()
        {
            //Arrange
            var seq  = new CaptureSequence();
            var seq2 = new CaptureSequence()
            {
                Enabled = false
            };
            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.STANDARD;
            l.Add(seq);
            l.Add(seq2);

            //Act
            var nextSeq = l.Next();

            //Assert
            Assert.AreEqual(string.Empty, l.TargetName, "Targetname");
            Assert.AreSame(seq, nextSeq);
            Assert.AreEqual(1, l.Count);
            Assert.AreSame(seq, l.ActiveSequence);
            Assert.AreEqual(1, l.ActiveSequenceIndex);
            Assert.AreEqual(0, l.Delay);
        }
Exemplo n.º 6
0
        public void GetNextSequence_ModeRotate_AllFinished()
        {
            //Arrange
            var seq = new CaptureSequence()
            {
                TotalExposureCount = 5
            };
            var seq2 = new CaptureSequence()
            {
                TotalExposureCount = 5
            };
            var seq3 = new CaptureSequence()
            {
                TotalExposureCount = 5
            };
            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.ROTATE;

            l.Add(seq);
            l.Add(seq2);
            l.Add(seq3);

            //Act
            CaptureSequence actualSeq;

            while ((actualSeq = l.Next()) != null)
            {
            }

            //Assert
            Assert.AreEqual(null, l.ActiveSequence);
            Assert.AreEqual(-1, l.ActiveSequenceIndex);
            Assert.AreEqual(0, l.Items.Where(x => x.ProgressExposureCount <x.TotalExposureCount || x.ProgressExposureCount> x.TotalExposureCount).Count());
        }
Exemplo n.º 7
0
        public void GetNextSequence_ModeRotateOneDisabled_FirstEmptySecondDisabledThirdSelected()
        {
            //Arrange
            var seq = new CaptureSequence()
            {
                ProgressExposureCount = 0, TotalExposureCount = 0
            };
            var seq2 = new CaptureSequence()
            {
                ProgressExposureCount = 5, TotalExposureCount = 10, Enabled = false
            };
            var seq3 = new CaptureSequence()
            {
                ProgressExposureCount = 5, TotalExposureCount = 7
            };
            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.ROTATE;

            l.Add(seq);
            l.Add(seq2);
            l.Add(seq3);

            //Act
            var actual = l.Next();

            //Assert
            Assert.AreSame(seq3, actual);
        }
Exemplo n.º 8
0
        public void RunSequenceMultipleTimes_ModeRotate_NumberOfExposuresCorrect()
        {
            var seq1 = new CaptureSequence()
            {
                TotalExposureCount = 50
            };
            var seq2 = new CaptureSequence()
            {
                TotalExposureCount = 10
            };
            var seq3 = new CaptureSequence()
            {
                TotalExposureCount = 30
            };

            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.ROTATE;
            l.Add(seq1);

            while (l.Next() != null)
            {
            }

            l.Add(seq2);

            while (l.Next() != null)
            {
            }

            l.Add(seq3);

            while (l.Next() != null)
            {
            }

            Assert.AreEqual(50, seq1.ProgressExposureCount);
            Assert.AreEqual(10, seq2.ProgressExposureCount);
            Assert.AreEqual(30, seq3.ProgressExposureCount);
        }
Exemplo n.º 9
0
        public void GetNextSequence_ModeRotate_EmptyListNextNull()
        {
            //Arrange
            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.ROTATE;

            //Act
            var actual = l.Next();

            //Assert
            Assert.AreSame(null, actual);
            Assert.AreEqual(null, l.ActiveSequence);
            Assert.AreEqual(-1, l.ActiveSequenceIndex);
        }
Exemplo n.º 10
0
        public void GetNextSequence_ModeRotateOneDisabled_EmptyListNextNull()
        {
            //Arrange
            var seq = new CaptureSequence()
            {
                TotalExposureCount = 5, Enabled = false
            };
            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.ROTATE;
            l.Add(seq);

            //Act
            var actual = l.Next();

            //Assert
            Assert.AreSame(null, actual);
            Assert.AreEqual(null, l.ActiveSequence);
            Assert.AreEqual(-1, l.ActiveSequenceIndex);
        }
Exemplo n.º 11
0
        public void GetNextSequence_ModeStandardOneDisabled_AllFinished()
        {
            //Arrange
            var seq = new CaptureSequence()
            {
                TotalExposureCount = 5
            };
            var seq2 = new CaptureSequence()
            {
                ProgressExposureCount = 0, TotalExposureCount = 5, Enabled = false
            };
            var seq3 = new CaptureSequence()
            {
                TotalExposureCount = 5
            };
            var l = new CaptureSequenceList();

            l.Mode = SequenceMode.STANDARD;

            l.Add(seq);
            l.Add(seq2);
            l.Add(seq3);

            //Act
            CaptureSequence actualSeq;

            while ((actualSeq = l.Next()) != null)
            {
            }

            //Assert
            Assert.AreEqual(null, l.ActiveSequence);
            Assert.AreEqual(-1, l.ActiveSequenceIndex);
            Assert.AreEqual(1, l.Items.Where(x => x.ProgressExposureCount < x.TotalExposureCount).Count());
            Assert.AreEqual(5, seq.ProgressExposureCount);
            Assert.AreEqual(0, seq2.ProgressExposureCount);
            Assert.AreEqual(5, seq3.ProgressExposureCount);
        }