Пример #1
0
 public void CannotSetupBeforeConnection()
 {
     using (var device = new TestAcquisitionDevice())
     {
         device.Setup();
     }
 }
Пример #2
0
        public void CanSetupDevice()
        {
            using (var device = new TestAcquisitionDevice())
            {
                device.Connect();

                var id1 = Guid.NewGuid();
                var id2 = Guid.NewGuid();

                device.Channels.Add(new PhysicalChannel(id1)
                {
                    Name = "1", SamplingRate = 100
                });
                device.Channels.Add(new PhysicalChannel(id2)
                {
                    Name = "2", SamplingRate = 100
                });
                device.Channels.Seal();

                // These are basic tests on PhysicalChannelCollection. If they grow in number
                // then it may be worth to move to a separate class.
                Assert.IsTrue(device.Channels.Contains(id1));
                Assert.IsTrue(device.Channels.Contains(id2));
                Assert.IsFalse(device.Channels.Contains(Guid.NewGuid()));
                Assert.IsTrue(device.Channels[id1].Id == id1);

                device.Setup();
            }
        }
Пример #3
0
 public void CannotSetupWithoutChannels()
 {
     using (var device = new TestAcquisitionDevice())
     {
         device.Connect();
         device.Setup();
     }
 }
Пример #4
0
        public void MustSealChannels()
        {
            using (var device = new TestAcquisitionDevice())
            {
                device.Connect();

                device.Channels.Add(new PhysicalChannel(Guid.NewGuid())
                {
                    Name = "1", SamplingRate = 100
                });

                device.Setup();
            }
        }
Пример #5
0
        public void ByDefaultCannotSetupForMultifrequency()
        {
            using (var device = new TestAcquisitionDevice())
            {
                device.Connect();

                device.Channels.Add(new PhysicalChannel(Guid.NewGuid())
                {
                    Name = "1", SamplingRate = 100
                });
                device.Channels.Add(new PhysicalChannel(Guid.NewGuid())
                {
                    Name = "2", SamplingRate = 200
                });

                device.Setup();
            }
        }
Пример #6
0
        public void CannotSetupWithDuplicatedChannelIds()
        {
            using (var device = new TestAcquisitionDevice())
            {
                device.Connect();

                device.Channels.Add(new PhysicalChannel(Guid.Empty)
                {
                    Name = "1", SamplingRate = 100
                });
                device.Channels.Add(new PhysicalChannel(Guid.Empty)
                {
                    Name = "2", SamplingRate = 100
                });

                device.Setup();
            }
        }