示例#1
0
 public void can_get_home_happy_path()
 {
     var homeController = new HomeController();
     var indexPage = homeController.Index() as ViewResult;
     var title = (string) indexPage.ViewBag.Title;
     title.Should().Be("TextMatch Home Page");
 }
        public void Index()
        {
            // Arrange
            HomeController controller = new HomeController();

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

            // Assert
            Assert.IsNotNull(result);
        }
        public void GetPositionsTest4()
        {
            HomeController controller = new HomeController();

            var text = "Polly put the kettle on, polly put the kettle on, polly put the kettle on we’ll all have tea";
            var subText = "the";

            var positions = controller.GetPositions( text, subText );

            // Assert
            Assert.AreEqual( "11, 36, 61", positions );
        }
        public void GetPositionsTest10()
        {
            HomeController controller = new HomeController();

            var text = "Polly put the kettle on, polly put the kettle on, polly put the kettle on we’ll all have tea";
            var subText = "Polly put the kettle on, polly put the kettle on, polly put the kettle on we’ll all have tea Polx";

            var positions = controller.GetPositions( text, subText );

            // Assert
            Assert.AreEqual( "There is no output", positions );
        }
        public void GetPositionsTest5()
        {
            HomeController controller = new HomeController();

            var text = "Polly put the kettle on, polly put the kettle on, polly put the kettle on we’ll all have tea";
            var subText = "ll";

            var positions = controller.GetPositions( text, subText );

            // Assert
            Assert.AreEqual( "3, 28, 53, 78, 82", positions );
        }
 public void SetUp()
 {
     ControllerToTest = new HomeController();
     ModelToTest = new StringMatchModel();
 }