GetUserWithRolesByNameIdentifier() public method

Returns User
public GetUserWithRolesByNameIdentifier ( string nameIdentifier ) : Microsoft.Research.DataOnboarding.DomainModel.User
nameIdentifier string NameIndentifier of the user
return Microsoft.Research.DataOnboarding.DomainModel.User
        public void Throw_Exception_If_NameIdentifier_Does_Not_Exist()
        {
            // Prepare
            IUnitOfWork unitOfWork = new Fakes.StubIUnitOfWork();
            IUserRepository userRepository =
                new Fakes.StubIUserRepository()
                {
                    GetUserByNameIdentifierString = (nameIdentifier) => { return null; }
                };

            // Perform
            IUserService userService = new UserServiceProvider(userRepository, unitOfWork);
            userService.GetUserWithRolesByNameIdentifier("somenameidentifier");
        }
        public void Throw_Exception_If_NameIdentifier_Is_Null_Empty_Or_Whitespace()
        {
            // Prepare
            IUnitOfWork unitOfWork = new Fakes.StubIUnitOfWork();
            IUserRepository userRepository = new Fakes.StubIUserRepository();

            // Perform
            IUserService userService = new UserServiceProvider(userRepository, unitOfWork);
            userService.GetUserWithRolesByNameIdentifier(" ");
        }
        public void Get_User_With_Roles_For_Valid_NameIdentifier()
        {
            // Prepare
            User fakeUser = new User()
                {
                    UserId = 1,
                    NameIdentifier = "s0Me1De9Tf!Er$tRing",
                    FirstName = "SomeFirstName",
                    MiddleName = "SomeMiddleName",
                    LastName = "SomeLastName",
                    IdentityProvider = "Windows Live",
                    Organization = "SomeOrganization",
                    EmailId = "*****@*****.**",
                    CreatedOn = DateTime.Now,
                    ModifiedOn = DateTime.Now,
                    IsActive = true,
                    UserRoles = {
                                    new UserRole
                                    {
                                        RoleId=2,
                                        UserId=1,
                                        Role = new Role(){ Name = "User" }
                                    }
                                }
                };
            IUnitOfWork unitOfWork =
                new Fakes.StubIUnitOfWork();
            IUserRepository userRepository =
                new Fakes.StubIUserRepository()
                {
                    GetUserByNameIdentifierString = (nameIdentifier) => { return fakeUser; }
                };

            // Perform
            IUserService userService = new UserServiceProvider(userRepository, unitOfWork);
            User retrievedUser = userService.GetUserWithRolesByNameIdentifier("s0Me1De9Tf!Er$tRing");

            // Assert
            Assert.IsNotNull(retrievedUser);
            Assert.AreEqual(retrievedUser.NameIdentifier, fakeUser.NameIdentifier);
            Assert.IsTrue(retrievedUser.UserRoles.Count > 0);
        }