public void GetStreamReturnsNullForUnknownName()
        {
            var c = new SimpleDAQController();

            const string name       = "stream-name";
            const string distractor = "distractor-name";
            var          outStream  = new DAQOutputStream(name);

            (c as IMutableDAQController).AddStream(outStream);

            Assert.That(c.GetStream <IDAQOutputStream>(distractor), Is.Null);
            Assert.That(c.GetStream <IDAQInputStream>(distractor), Is.Null);
            Assert.That(c.GetStream <IDAQInputStream>(name), Is.Null);
        }
        public void GetStreamReturnsStreamWithName()
        {
            var c = new SimpleDAQController();

            const string name      = "stream-name";
            var          outStream = new DAQOutputStream(name);

            (c as IMutableDAQController).AddStream(outStream);
            var inputStream = new DAQInputStream(name);

            (c as IMutableDAQController).AddStream(inputStream);

            Assert.That(c.GetStream <IDAQOutputStream>(name), Is.EqualTo(outStream));
            Assert.That(c.GetStream <IDAQInputStream>(name), Is.EqualTo(inputStream));
        }
        public void ShouldThrowForMultipleStreamsWhenGettingStream()
        {
            var c = new SimpleDAQController();

            string name = "stream-name";

            (c as IMutableDAQController).AddStream(new DAQOutputStream(name));
            (c as IMutableDAQController).AddStream(new DAQOutputStream(name));

            Assert.Throws <InvalidOperationException>(() => c.GetStream(name));
        }
        public void ShouldThrowForMultipleStreamsWhenGettingTypedStream()
        {
            var c = new SimpleDAQController();

            string name = "stream-name";
            (c as IMutableDAQController).AddStream(new DAQOutputStream(name));
            (c as IMutableDAQController).AddStream(new DAQOutputStream(name));

            Assert.Throws<InvalidOperationException>(() => c.GetStream<IDAQOutputStream>(name));
        }
        public void GetStreamReturnsStreamWithName()
        {
            var c = new SimpleDAQController();

            const string name = "stream-name";
            var outStream = new DAQOutputStream(name);
            (c as IMutableDAQController).AddStream(outStream);
            var inputStream = new DAQInputStream(name);
            (c as IMutableDAQController).AddStream(inputStream);

            Assert.That(c.GetStream<IDAQOutputStream>(name), Is.EqualTo(outStream));
            Assert.That(c.GetStream<IDAQInputStream>(name), Is.EqualTo(inputStream));
        }
        public void GetStreamReturnsNullForUnknownName()
        {
            var c = new SimpleDAQController();

            const string name = "stream-name";
            const string distractor = "distractor-name";
            var outStream = new DAQOutputStream(name);
            (c as IMutableDAQController).AddStream(outStream);

            Assert.That(c.GetStream<IDAQOutputStream>(distractor), Is.Null);
            Assert.That(c.GetStream<IDAQInputStream>(distractor), Is.Null);
            Assert.That(c.GetStream<IDAQInputStream>(name), Is.Null);
        }