public void ShouldSetBackgroundForMode()
        {
            const string units = "V";

            var c = new Controller();
            var mc = new FakeMulticlampCommander();

            var VClampBackground = new Measurement(2, -3, units);
            var operatingMode = MultiClampInterop.OperatingMode.VClamp;
            var background = new Dictionary<MultiClampInterop.OperatingMode, IMeasurement>() { { operatingMode, VClampBackground } };

            var mcd = new MultiClampDevice(mc, c, background);

            var IClampMode = MultiClampInterop.OperatingMode.IClamp;
            var IClampBackground = new Measurement(-1, "A");

            mcd.SetBackgroundForMode(IClampMode, IClampBackground);

            Assert.That(mcd.BackgroundForMode(IClampMode), Is.EqualTo(IClampBackground));
            Assert.That(mcd.BackgroundForMode(operatingMode), Is.EqualTo(VClampBackground));
        }
        public void ShouldAllowBackgroundDefinitionViaString()
        {
            const string VClampUnits = "V";
            const string IClampUnits = "A";

            Measurement VClampBackground = new Measurement(2, -3, VClampUnits);
            Measurement IClampBackground = new Measurement(-10, -3, IClampUnits);

            var c = new Controller();
            var mc = new FakeMulticlampCommander();

            var bg = new Dictionary<MultiClampInterop.OperatingMode, IMeasurement>()
                         {
                             {MultiClampInterop.OperatingMode.VClamp, VClampBackground},
                             {MultiClampInterop.OperatingMode.IClamp, IClampBackground},
                         };

            var mcd = new MultiClampDevice(mc.SerialNumber, mc.Channel, c.Clock, c, new List<string>() { "VClamp", "IClamp" }, bg.Values);

            Assert.That(mcd.BackgroundForMode(MultiClampInterop.OperatingMode.VClamp), Is.EqualTo(VClampBackground));
            Assert.That(mcd.BackgroundForMode(MultiClampInterop.OperatingMode.IClamp), Is.EqualTo(IClampBackground));
        }