private void OnInvite(object obj) { model_UpdateStatusMessage(Resources.InviteRequestStart); if (!model.IsLoggedIn) { model.Authenticate(); } if (!model.IsLoggedIn) { model_UpdateStatusMessage(Resources.AuthenticationFailedMessage, true); return; } model.Send(); }
public void SendRequestTest() { // Create mock of rest client. var restClient = new Mock <RestClient>(); restClient.Setup(x => x.Execute(It.IsAny <IRestRequest>())) .Returns(new RestResponse() { StatusCode = HttpStatusCode.OK }); // Create Invite model. inviteModel = new InviteModel(authenticationProvider.Object, restClient.Object); var response = inviteModel.Send(); Assert.True(response); }