Beispiel #1
0
        public void Test_030()
        {
            WebApplicationTest.Controllers.HomeController
                homeController = new WebApplicationTest.Controllers.HomeController();

            var result =
                homeController.Action0200(name: "Dariush");

            Xunit.Assert.IsType <Microsoft.AspNetCore.Mvc.ViewResult>(@object: result);
        }
Beispiel #2
0
        public void Test_010()
        {
            WebApplicationTest.Controllers.HomeController
                homeController = new WebApplicationTest.Controllers.HomeController();

            string actual =
                homeController.Action0100(name: "Dariush");

            string expected = "Hello, Dariush!";

            Xunit.Assert.Equal
                (expected: expected, actual: actual);
        }
Beispiel #3
0
        public void Test_050()
        {
            // ************************************************
            Test_040();
            // ************************************************

            WebApplicationTest.Controllers.HomeController
                homeController = new WebApplicationTest.Controllers.HomeController();

            var result =
                homeController.Action0200(name: "Dariush")
                as Microsoft.AspNetCore.Mvc.ViewResult;

            object actual =
                result.ViewData["Message"];

            Xunit.Assert.IsType <string>(@object: actual);
        }
Beispiel #4
0
        public void Test_040()
        {
            // ************************************************
            Test_030();
            // ************************************************

            WebApplicationTest.Controllers.HomeController
                homeController = new WebApplicationTest.Controllers.HomeController();

            var result =
                homeController.Action0200(name: "Dariush")
                as Microsoft.AspNetCore.Mvc.ViewResult;

            bool actual =
                result.ViewData.Keys.Contains("Message");

            Xunit.Assert.True(condition: actual);
        }
Beispiel #5
0
        public void Test_060()
        {
            // ************************************************
            Test_050();
            // ************************************************

            WebApplicationTest.Controllers.HomeController
                homeController = new WebApplicationTest.Controllers.HomeController();

            var result =
                homeController.Action0200(name: "Dariush")
                as Microsoft.AspNetCore.Mvc.ViewResult;

            object actual =
                result.ViewData["Message"] as string;

            string expected =
                "Hello, Dariush!";

            Xunit.Assert.Equal
                (expected: expected, actual: actual);
        }