public void WhoAmINeedsService() { var messageBroker = A.Fake <IMessageBroker>(); A.CallTo(() => messageBroker.Show(Resources.MISSING_ORGANIZATION_SERVICE)).Returns(DialogResult.OK); var prototypesContainer = new PrototypesContainer(); prototypesContainer.InitializeBindings(new ToolViewModel { MessageBroker = messageBroker }); prototypesContainer.BtnWhoAmI_Click(prototypesContainer, new EventArgs()); A.CallTo(() => messageBroker.Show(Resources.MISSING_ORGANIZATION_SERVICE)).MustHaveHappened(1, Times.Exactly); }
public void WhoAmINeedsService() { _context.CallerId = new EntityReference("systemuser") { Id = Guid.NewGuid() }; var messageBroker = A.Fake <IMessageBroker>(); A.CallTo(() => messageBroker.Show(string.Format(Resources.HELLO_USERID, _context.CallerId.Id))).Returns(DialogResult.OK); var prototypesContainer = new PrototypesContainer(); prototypesContainer.InitializeBindings(new ToolViewModel { MessageBroker = messageBroker, OrganizationService = _service }); prototypesContainer.BtnWhoAmI_Click(prototypesContainer, new EventArgs()); A.CallTo(() => messageBroker.Show(string.Format(Resources.HELLO_USERID, _context.CallerId.Id))).MustHaveHappened(1, Times.Exactly); }