示例#1
0
        public void  TestPostSqr()
        {
            var           controller = new ValuesController();
            NumParameters parameter  = new NumParameters();

            parameter.Sqr = 16;
            string response = controller.PostSqr(parameter, 1);

            Assert.Equal("Square=4", response);
        }
示例#2
0
        public void  TestPostDiv()
        {
            var           controller = new ValuesController();
            NumParameters parameter  = new NumParameters();

            parameter.Dividend = 6;
            parameter.Divisor  = 2;
            string response = controller.PostDiv(parameter, 1);

            Assert.Equal("Quotient=3 Remainder=0", response);
        }
示例#3
0
        public void  TestPostFactors()
        {
            double[]      array      = { 2, 2, 3 };
            var           controller = new ValuesController();
            NumParameters parameter  = new NumParameters();

            parameter.Numbers = array;
            string response = controller.PostFactors(parameter, 1);

            Assert.Equal("Datafile=12", response);
        }
示例#4
0
        public void  TestPostsub()
        {
            var           controller = new ValuesController();
            NumParameters parameter  = new NumParameters();

            parameter.Minuend    = 7;
            parameter.Subtrahend = 3;

            string response = controller.Postsub(parameter, 1);

            Assert.Equal("Difference=4", response);
        }