Exemple #1
0
        public async Task AdapterTest_Adapt_Success()
        {
            await RunWithTelemetryAsync(
                totalOfExecutions : 1,
                runInParallel : false,
                handler : async execution =>
            {
                #region Arrange
                var signUpCommand = new SignUpCommand(UserSessionInfo, GlobalizationInfo, null)
                {
                    Email     = "*****@*****.**",
                    FirstName = "Marcelo",
                    LastName  = "Castelo Branco",
                    Password  = "******"
                };
                var customer   = new Customer();
                var systemUser = new SystemUser();

                var customerAdapter   = new CustomerAdapter();
                var systemUserAdapter = new SystemUserAdapter();
                #endregion

                #region Act
                customerAdapter.Adapt(customer, signUpCommand);
                systemUserAdapter.Adapt(systemUser, signUpCommand);
                #endregion

                #region Assert
                return(await Task.FromResult(
                           customer.Email == signUpCommand.Email &&
                           customer.FirstName == signUpCommand.FirstName &&
                           customer.LastName == signUpCommand.LastName &&
                           systemUser.Password == signUpCommand.Password &&
                           systemUser.Username == signUpCommand.Email
                           ).ConfigureAwait(false));

                #endregion
            }
                ).ConfigureAwait(false);
        }