예제 #1
0
        public IActionResult Index()
        {
            HelloServiceModel helloServiceModel = new()
            {
                UserName     = _helloService.UserName,
                HelloMessage = _helloService.GetHelloMessage()
            };

            return(View("Index", helloServiceModel));
        }
예제 #2
0
        // GET: Hello
        public ActionResult Index()
        {
            var helloViewModel = new HelloViewModel();

            helloViewModel.Message         = _helloService.GetHelloMessage();
            helloViewModel.CurrentDateTime = DateTime.Now;
            helloViewModel.CurrentUser     = UserContext.UserName;

            return(View(helloViewModel));
        }
예제 #3
0
        public void GetHelloMessageTest()
        {
            string helloMessage = _helloService.GetHelloMessage();

            Assert.Equal("hello test user 1", helloMessage);
        }
예제 #4
0
        public void Can_GetHelloMessage_WorkProperly()
        {
            string helloMessage = _helloService.GetHelloMessage(_userName);

            Assert.Equal("Hello test user", helloMessage);
        }