Example #1
0
        public void OutputData_DataWithExternalDeviceConfigFailsWithNonNullExistingConfig()
        {
            IOutputData data = new OutputData(this.Data, UNUSED_SRATE, false).
                               DataWithExternalDeviceConfiguration(devFake, new Dictionary <string, object>());

            Assert.Throws <ExistingConfigurationException>(
                () => data.DataWithExternalDeviceConfiguration(devFake, new Dictionary <string, object>()));
        }
Example #2
0
        public void TestOutputDataHasNodeConfiguration()
        {
            IOutputData outData = new OutputData(Data, UNUSED_SRATE, false);

            Assert.False(outData.HasNodeConfiguration(devFake.Name));

            outData = outData.DataWithExternalDeviceConfiguration(devFake, new Dictionary <string, object>());

            Assert.True(outData.HasNodeConfiguration(devFake.Name));
        }
Example #3
0
        public void OutputData_SetsExternalDeviceConfig()
        {
            var config = new Dictionary <string, object>();

            IOutputData data = new OutputData(Data, UNUSED_SRATE, false);

            data = data.DataWithExternalDeviceConfiguration(devFake, config);

            Assert.That(data.NodeConfigurationWithName(devFake.Name).Configuration,
                        Is.EqualTo(config));
        }
Example #4
0
        public void ConcatThrowsWithEitherExternalDeviceConfiguration()
        {
            IMeasurement srate = new Measurement(1000, "Hz");

            IOutputData outData1 = new OutputData(this.Data,
                                                  srate, false);

            IOutputData outData2 = new OutputData(this.Data,
                                                  srate, false);

            Assert.DoesNotThrow(() => outData1.Concat(outData2));

            var dev = new UnitConvertingExternalDevice("DevName", "DevManufacturer", new Measurement(0, "V"));

            var outData3 = outData1.DataWithExternalDeviceConfiguration(dev, new Dictionary <string, object>());

            Assert.Throws <ArgumentException>(() => outData3.Concat(outData2));
            Assert.Throws <ArgumentException>(() => outData2.Concat(outData3));
        }