예제 #1
0
        public void Index_Default_Allpositions()
        {
            // Arrange - create the controller
            PositionController target = new PositionController(mock.Object);

            // Act - call the action method
            IEnumerable <Position> result       = (IEnumerable <Position>)target.Index().Model;
            List <Position>        positionView = result.ToList <Position>();

            // Assert - check the result
            CollectionAssert.AreEqual(mock.Object.Positions, positionView);
        }
예제 #2
0
        public void IndexView_True()
        {
            // Arrange - create the controller

            PositionController target = new PositionController(mock.Object);

            // Act - call the action method
            ViewResult result = target.Index();

            // Assert - check the result
            Assert.AreEqual("", result.ViewName);
        }