Esempio n. 1
0
        public async void UserCreationProcessTests()
        {
            // Setup
            Bootstrap.Run(new string[0], builder =>
            {
                builder.RegisterType <TestSmtpClient>().AsImplementedInterfaces();
            });


            PostAccountModel postAccountModel = new PostAccountModel()
            {
                LoginName = Guid.NewGuid().ToString(),
                Password  = Guid.NewGuid().ToString(),
                ZipCode   = "12-234",
                Email     = "*****@*****.**"
            };

            // Act
            string confirmationId = await RestClient.For <IAccountsApi>(_url).PostAccount(postAccountModel);

            await RestClient.For <IAccountsApi>(_url).PutAccountConfirmation(confirmationId, new PutConfirmationModel(true));

            // Assert
            GetAccountModel getAccountModel = await RestClient.For <IAccountsApi>(_url).Get(postAccountModel.LoginName);

            Assert.Equal(postAccountModel.Email, getAccountModel.Email);
            Assert.Equal(postAccountModel.LoginName, getAccountModel.LoginName);
            Assert.Equal(2, TestSmtpClient.SentEmails.Count);
        }
Esempio n. 2
0
        private async Task CreateUser(string loginName)
        {
            PostAccountModel postAccountModel = new PostAccountModel()
            {
                LoginName = loginName,
                Password  = Guid.NewGuid().ToString(),
                ZipCode   = "12-234",
                Email     = "*****@*****.**"
            };

            string confirmationId = await RestClient.For <IAccountsApi>(_url).PostAccount(postAccountModel);

            await RestClient.For <IAccountsApi>(_url).PutAccountConfirmation(confirmationId, new PutConfirmationModel(true));
        }