Example #1
0
        public async Task Test_Joueur_Index_Returns_A_ViewResult()
        {
            // Arrange
            var mockRepo   = new MockJoueurRepository();
            var controller = new JoueursController(mockRepo);

            // Act
            var result = await controller.Index();

            // Assert
            Assert.IsType <ViewResult>(result);
        }
Example #2
0
        public async Task Test_Joueur_Index_Model_Is_An_Enumerable_Model_of_Joueurs()
        {
            // Arrange
            var mockRepo   = new MockJoueurRepository();
            var controller = new JoueursController(mockRepo);

            //Act
            var result = await controller.Index() as ViewResult;

            var model = result.ViewData.Model;

            //Assert
            Assert.IsAssignableFrom <IEnumerable <Joueur> >(model);
        }
Example #3
0
        public async Task Test_Index_Model_Contains_Joueurs()
        {
            // Arrange
            var mockRepo   = new MockJoueurRepository();
            var controller = new JoueursController(mockRepo);

            //Act
            var result = await controller.Index() as ViewResult;

            var model = result.ViewData.Model;
            var list  = model as IEnumerable <Joueur>;

            //Assert
            Assert.Equal(3, list.Count());
        }
        public async Task Test_Index_Returns_A_ViewResult()
        {
            var result = await controller.Index();

            var viewResult = Assert.IsType <ViewResult>(result);
        }