Exemplo n.º 1
0
        public void Returns_Sum()
        {
            var controller = new SimpleSurfaceController(umbracoContext, new UmbracoHelper(umbracoContext));

            var model = new AdditionModel
            {
                IsPosted = true,
                X        = 3,
                Y        = 5
            };
            var result = (AdditionModel)controller.AddForm(model).Model;

            Assert.AreEqual(8, result.Sum);
        }
        public void Posting_AddModel_Calculates_Result()
        {
            const int expectedSum = 3;
            var       model       = new AdditionModel
            {
                X        = 1,
                Y        = 2,
                IsPosted = true
            };

            var controller  = new SimpleSurfaceController();
            var result      = controller.AddForm(model);
            var resultModel = (AdditionModel)result.Model;

            Assert.AreEqual(expectedSum, resultModel.Sum);
        }