コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }