public void Constructor_ExpectArgumentNullExceptionForHandler()
        {
            //Arrange
            ThermometerQuestion q = new ThermometerQuestion("/abc");

            //Act
            ThermometerHandler th = new ThermometerHandler(q, null);

            //Assert
        }
        public void Constructor_ExpectArgumentNullExceptionForQuestion()
        {
            //Arrange
            var h = new Func <IThermometerQuestion, string>(question => "question");

            //Act
            ThermometerHandler th = new ThermometerHandler(null, h);

            //Assert
        }
        public void Constructor_ExpectArgumentNullExceptionForHandler()
        {
            //Arrange
            ThermometerQuestion q = new ThermometerQuestion("/abc");
            
            //Act
            ThermometerHandler th = new ThermometerHandler(q, null);

            //Assert
        }
        public void Constructor_ExpectArgumentNullExceptionForQuestion()
        {
            //Arrange
            var h = new Func<IThermometerQuestion, string>(question => "question");

            //Act
            ThermometerHandler th = new ThermometerHandler(null, h);

            //Assert
        }
        public void FindOrDefault_ShouldFind()
        {
            //Arrange
            ThermometerHandler          th = new ThermometerHandler(new ThermometerQuestion("/abc"), question => "def?");
            ThermometerRouteHandlerPool tp = new ThermometerRouteHandlerPool();

            tp.Add(th);

            //Act
            //Assert
            Assert.AreEqual(th, tp.FindOrDefault("/abc"));
            Assert.IsNull(tp.FindOrDefault("/def"));
        }
        public void Add_ShouldAddOneElement()
        {
            //Arrange
            ThermometerHandler          th = new ThermometerHandler(new ThermometerQuestion("/abc"), question => "def?");
            ThermometerRouteHandlerPool tp = new ThermometerRouteHandlerPool();

            //Act
            tp.Add(th);

            //Assert
            Assert.AreEqual(1, tp.Count());
            Assert.AreEqual(th, tp.First());
        }
        public void FindOrDefault_ShouldFind()
        {
            //Arrange
            ThermometerHandler th = new ThermometerHandler(new ThermometerQuestion("/abc"), question => "def?");
            ThermometerRouteHandlerPool tp = new ThermometerRouteHandlerPool();
            tp.Add(th);

            //Act
            //Assert
            Assert.AreEqual(th,tp.FindOrDefault("/abc"));
            Assert.IsNull(tp.FindOrDefault("/def"));

        }
        public void Contains_ShouldReturnByRoute()
        {
            //Arrange
            ThermometerHandler th = new ThermometerHandler(new ThermometerQuestion("/abc"), question => "def?");
            ThermometerRouteHandlerPool tp = new ThermometerRouteHandlerPool();
            tp.Add(th);

            //Act

            //Assert
            Assert.IsTrue(tp.Contains("/abc"));
            Assert.IsFalse(tp.Contains("/def"));
        }
        public void Add_ShouldAddOneElement()
        {
            //Arrange
            ThermometerHandler th = new ThermometerHandler(new ThermometerQuestion("/abc"), question => "def?" );
            ThermometerRouteHandlerPool tp = new ThermometerRouteHandlerPool();

            //Act
            tp.Add(th);

            //Assert
            Assert.AreEqual(1, tp.Count());
            Assert.AreEqual(th, tp.First());
        }
        public void Constructor_ShouldSetQuestionAndHandler()
        {
            //Arrange
            ThermometerQuestion q = new ThermometerQuestion("/abc");
            var h = new Func <IThermometerQuestion, string>(question => "question");

            //Act
            ThermometerHandler th = new ThermometerHandler(q, h);

            //Assert
            Assert.AreEqual(q, th.Question);
            Assert.AreEqual(h, th.Handler);
        }
        public void Constructor_ShouldSetQuestionAndHandler()
        {
            //Arrange
            ThermometerQuestion q = new ThermometerQuestion("/abc");
            var h = new Func<IThermometerQuestion, string>(question => "question");

            //Act
            ThermometerHandler th = new ThermometerHandler(q, h);

            //Assert
            Assert.AreEqual(q, th.Question);
            Assert.AreEqual(h, th.Handler);
        }
        public void Contains_ShouldReturnByRoute()
        {
            //Arrange
            ThermometerHandler          th = new ThermometerHandler(new ThermometerQuestion("/abc"), question => "def?");
            ThermometerRouteHandlerPool tp = new ThermometerRouteHandlerPool();

            tp.Add(th);

            //Act

            //Assert
            Assert.IsTrue(tp.Contains("/abc"));
            Assert.IsFalse(tp.Contains("/def"));
        }