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

            return(View("Index", helloServiceModel));
        }
Esempio n. 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));
        }
Esempio n. 3
0
        public void GetHelloMessageTest()
        {
            string helloMessage = _helloService.GetHelloMessage();

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

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