CreateUser() private method

private CreateUser ( string name ) : User,
name string
return User,
Ejemplo n.º 1
0
        public void CreateUserWithNewEmailTest()
        {
            var email    = "*****@*****.**";
            var password = "******";

            var response = service.CreateUser(email, password);

            Assert.IsTrue(response.IsSuccess);
            Assert.AreEqual(Resources.Messages.CreateUserSuccess, response.Message);
        }
        public void UserCreation_UserAlreadyExists_Fail()
        {
            var user = new UserAccount
            {
                Username        = "******",
                IsActive        = true,
                IsFirstTimeUser = false,
                RoleType        = "standard"
            };
            var claims = new List <Claim>()
            {
                new Claim("User", "*****@*****.**")
            };
            var expected = false;
            var actual   = false;

            using (_userGateway = new UserGateway())
            {
                UserManagementService _userManagementService = new UserManagementService(_userGateway);

                // Act
                actual = _userManagementService.CreateUser(user, claims).Data;
            }

            //Assert
            Assert.AreEqual(expected, actual);
        }
        public async Task CreateUser()
        {
            var user = await UserMocks.UserMock();

            _userMock.Setup(x => x.CreateItemAsync(user)).Returns(Task.FromResult(true));
            var  service = new UserManagementService(_userMock.Object);
            bool created = await service.CreateUser(user);

            Assert.True(created);
        }
        public void UserCreation_NullInput_Fail()
        {
            UserAccount  user     = null;
            List <Claim> claims   = null;
            var          expected = false;
            var          actual   = false;

            using (_userGateway = new UserGateway())
            {
                UserManagementService _userManagementService = new UserManagementService(_userGateway);

                // Act
                actual = _userManagementService.CreateUser(user, claims).Data;
            }
            //Assert
            Assert.AreEqual(expected, actual);
        }