Detail() private method

private Detail ( int id ) : Task
id int
return Task
コード例 #1
0
        public async Task SuccessStoryController_Detail_Test10()
        {
            // Initialization
            SuccessStoryController ctl = new SuccessStoryController();

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

            // To test if it is a HttpNotFoundResult when the id is invalid
            // Assert.IsInstanceOfType(result, typeof(HttpNotFoundResult));
        }
コード例 #2
0
        public async Task SuccessStoryController_Detail_Test07()
        {
            // Initialization
            SuccessStoryController ctl = new SuccessStoryController();

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

            // To test if it is a valid id
            var model = (StoryIndexViewModel)((ViewResult)result).Model;
            Assert.IsNotNull(model);
        }