Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }