Exemplo n.º 1
0
        public void addNewUser_valid()
        {
            var FirstName = "Linda";
            var LastName  = "Jóhansdóttir";
            var Email     = "*****@*****.**";
            var Address   = "Hæðarsel 1";
            /// Arrange
            var model = new Friend
            {
                ID        = 5,
                FirstName = "Linda", LastName = "Jóhansdóttir",
                Email     = "*****@*****.**",
                Address   = "Hæðarsel 1"
            };

            /// Act
            _repo.AddNewUser(model);
            /// Assert
            var newUser = _userService.GetAllUsers(null, 0).Last();

            // Tests if values are valid
            Assert.IsNotNull(newUser);
            Assert.AreEqual(FirstName + " " + LastName, newUser.Name);
            Assert.AreEqual(Email, newUser.Email);
            Assert.AreEqual(Address, newUser.Address);
        }
Exemplo n.º 2
0
        public Friend AddNewUser(Friend newUser)
        {
            var user = _repo.AddNewUser(newUser);

            if (user != null)
            {
                return(user);
            }
            else
            {
                return(null);
            }
        }