public IActionResult Index() { HelloServiceModel helloServiceModel = new() { UserName = _helloService.UserName, HelloMessage = _helloService.GetHelloMessage() }; return(View("Index", helloServiceModel)); }
// GET: Hello public ActionResult Index() { var helloViewModel = new HelloViewModel(); helloViewModel.Message = _helloService.GetHelloMessage(); helloViewModel.CurrentDateTime = DateTime.Now; helloViewModel.CurrentUser = UserContext.UserName; return(View(helloViewModel)); }
public void GetHelloMessageTest() { string helloMessage = _helloService.GetHelloMessage(); Assert.Equal("hello test user 1", helloMessage); }
public void Can_GetHelloMessage_WorkProperly() { string helloMessage = _helloService.GetHelloMessage(_userName); Assert.Equal("Hello test user", helloMessage); }