示例#1
0
        public void TheSumIsCorrect()
        {
            var handler = new GetIntSumQueryHandler();
            var query   = new GetIntSumQuery()
            {
                First = 2, Second = 3
            };

            var sum = handler.Handle(query);

            Assert.That(sum, Is.EqualTo(5));
        }
示例#2
0
        public void WorksWithNegatives()
        {
            var handler = new GetIntSumQueryHandler();
            var query   = new GetIntSumQuery()
            {
                First = -2, Second = -3
            };

            var sum = handler.Handle(query);

            Assert.That(sum, Is.EqualTo(-5));
        }
示例#3
0
        public void WorksWithAZero()
        {
            var handler = new GetIntSumQueryHandler();
            var query   = new GetIntSumQuery()
            {
                First = 10, Second = 0
            };

            var sum = handler.Handle(query);

            Assert.That(sum, Is.EqualTo(10));
        }
 public ActionResult <int> Get([FromQuery] GetIntSumQuery query)
 {
     return(this.handler.Handle(query));
 }