GetUserCommonRole() public method

public GetUserCommonRole ( int userId ) : string
userId int
return string
        public void EqualRoles_ReturnedAsUserRole()
        {
            var userId = 1;
            var roles = new[] {"Frontend-developer", "Frontend-developer", "C#-developer", "Web-designer"};
            SetupMockReturnThisRolesList(roles, userId);
            var analyzer = new UserRoleAnalyzer(_projectRepositoryStub.Object, _userRoleAnalyzerSettings);

            var userRole = analyzer.GetUserCommonRole(userId);

            Assert.AreEqual("Frontend-developer", userRole);
        }
        public void NoRoles_ReturnDefaultRole()
        {
            var userId = 1;
            var roles = new string[] {};
            SetupMockReturnThisRolesList(roles, userId);
            var analyzer = new UserRoleAnalyzer(_projectRepositoryStub.Object, _userRoleAnalyzerSettings);

            var userRole = analyzer.GetUserCommonRole(userId);

            Assert.AreEqual("Developer", userRole);
        }
        public void ApproximatelyEqualRoles_ReturnedAsUserRole()
        {
            var userId = 1;
            var roles = new[] {"Frontend-developer", "Backend-developer", "Backend developer", "Web-designer"};
            SetupMockReturnThisRolesList(roles, userId);
            var analyzer = new UserRoleAnalyzer(_projectRepositoryStub.Object, _userRoleAnalyzerSettings);

            var userRole = analyzer.GetUserCommonRole(userId);

            Assert.IsTrue("Backend-developer" == userRole || "Backend developer" == userRole);
        }