コード例 #1
0
        public void TestProjectController_GetFormFilter(string httpMethod)
        {
            SetUpProjectControllerForTesting(httpMethod);
            projectController.CurrentUser = user;

            FormCollection form = new FormCollection();

            form.Add("UserId", "1234");
            form.Add("BusinessId", "123456");
            form.Add("ProjectStatusTypeId", "1");
            form.Add("ProjectOpenStatusTypeId", "2");
            form.Add("ProjectLeadStatusTypeId", "3");
            form.Add("DateTypeId", "4");
            form.Add("OnlyAlertProjects", "false");
            form.Add("ShowDeleteProjects", "false");
            form.Add("TotalRecords", "127");

            Dictionary <string, object> result = projectController.GetFormFilters(form) as Dictionary <string, object>;

            Assert.That(result, Is.Not.EqualTo(null));
            Assert.That(result.Count, Is.GreaterThan(0));
            Assert.That(result["UserId"], Is.EqualTo(1234));
            Assert.That(result["BusinessId"], Is.EqualTo(123456));
            Assert.That(result["ProjectStatusTypeId"], Is.EqualTo(1));
            Assert.That(result["ProjectOpenStatusTypeId"], Is.EqualTo(2));
            Assert.That(result["ProjectLeadStatusTypeId"], Is.EqualTo(ProjectLeadStatusTypeEnum.OpenOrder));
            Assert.That(result["DateTypeId"], Is.EqualTo(4));
            Assert.That(result["OnlyAlertProjects"], Is.EqualTo(false));
            Assert.That(result["ShowDeleteProjects"], Is.EqualTo(false));
            Assert.That(result["TotalRecords"], Is.EqualTo(127));
        }