コード例 #1
0
        public async Task TeamProfilesController_Edit_Test3()
        {
            // Initialization
            TeamProfilesController ctl = new TeamProfilesController();

            // To test if it is null
            var result = await ctl.Edit(1);
            Assert.IsNotNull(result);

            // To test if it is a valid id
            var model = (ProfileIndexViewModel)((ViewResult)result).Model;
            Assert.IsNotNull(model);
        }
コード例 #2
0
        public async Task TeamProfilesController_Edit_Test4()
        {
            // Initialization
            TeamProfilesController ctl = new TeamProfilesController();

            // To test if it is null
            var result = await ctl.Edit(1);
            var model = (ProfileIndexViewModel)((ViewResult)result).Model;
            model.teamProfile.name = "Anne";

            var result2 = ctl.Edit(model);
            Assert.IsNotNull(result);
        }
コード例 #3
0
        public async Task TeamProfilesController_Edit_Test2()
        {
            // Initialization
            TeamProfilesController ctl = new TeamProfilesController();

            // To test if it is null
            var result = await ctl.Edit(21);
            Assert.IsNotNull(result);

            // To test if it is a valid id
            Assert.IsInstanceOfType(result, typeof(HttpNotFoundResult));
            var model = (HttpNotFoundResult)result;
            Assert.AreEqual(404, model.StatusCode);
        }