public async Task UserExistsShouldInsteadUseHead()
        {
            string username = It.IsAny <String>();

            await clientWithMock.UserExists(username);

            mockBlockService.Verify(m => m.InvokeHead(HyperledgerConsts.TraderUrl, username));
        }
Example #2
0
        async void CompletedRegister(object sender, EventArgs e)
        {
            if (await client.UserExists(userId.Text))
            {
                await DisplayAlert("Alert", "The user Id have been taken", "Ok");
            }
            else
            {
                //if(client.UserExists())
                if (userId.Text != "" && fName.Text != "" && lName.Text != "" &&
                    userId.Text != null && fName.Text != null && lName.Text != null)
                {
                    User user = new User
                    {
                        username  = userId.Text,
                        firstName = fName.Text,
                        lastName  = lName.Text,
                        password  = password.Text
                    };

                    await client.RegisterNewTrader(user);
                    await DisplayAlert("Alert", "Sucessful register with user ID" + userId.Text, "Ok");

                    await Navigation.PopAsync();
                }
                else
                {
                    await DisplayAlert("Alert", "Make sure you fill all the box", "Ok");
                }
            }
        }