public void AssociateCollection_can_add_skill()
        {
            // AAA - Arrange, Act, Assert
            // Arrange
            var        sut = new AssociateCollection();
            IAssociate a1  = new Associate(() => new Role(),
                                           () => new RolePickList(() => new RoleCollection(),
                                                                  () => new Role()),
                                           () => new Skill(),
                                           () => new SkillPickList(() => new SkillCollection(),
                                                                   () => new Skill())
                                           )
            {
                AssociateID = 101, Name = "Aaron Schatzer", Tenure = 10, CurrentRoleID = 100
            };

            // Act
            sut.Add(a1);

            // Assert
            Assert.Multiple(() =>
            {
                Assert.That(sut.Count, Is.EqualTo(1));
                Assert.That(sut[0].AssociateID, Is.EqualTo(101));
                Assert.That(sut[0].Name, Is.EqualTo("Aaron Schatzer"));
            });
        }
Пример #2
0
        public ActionResult ReviewQueue(string status)
        {
            var pageSize = CookieValueAsInt(CookieNames.GridPageSize, Constants.DefaultPageSize);

            var model = new AssociateCollection
            {
                IsAdmin     = IsAdmin,
                IsReview    = true,
                PagingModel = new PagingModel(0, pageSize, 0),
                GridCaption = "Associate Review Queue"
            };

            switch (status.ToLower())
            {
            case "hire":
                model.CurrentMenuItem = "New Hires";
                model.ReviewMode      = ReviewModes.Hire;
                model.PageTitle       = "New Hires";
                model.DataAction      = "NewEmployeesSearch";
                model.ReviewAction    = "ReviewHire";
                model.AreaTitle       = "Recently Hired Associates";
                model.AreaMessage     =
                    "The associates in the grid below are new hires that have had roles assigned to them by the Resource One Security Manager rule engine.";
                break;

            case "fire":
                model.CurrentMenuItem = "Terminations";
                model.ReviewMode      = ReviewModes.Fire;
                model.PageTitle       = "Recent Terminations";
                model.DataAction      = "TermEmployeesSearch";
                model.ReviewAction    = "ReviewTerm";
                model.AreaTitle       = "Recently Terminated Associates";
                model.AreaMessage     =
                    "The associates in the grid below have been terminated and had their access removed by the Resource One Security Manager rule engine.";
                break;

            case "changed":
                model.CurrentMenuItem = "Changed";
                model.ReviewMode      = ReviewModes.Changed;
                model.PageTitle       = "Changed Associates";
                model.DataAction      = "ChangedEmployeesSearch";
                model.ReviewAction    = "Review";
                model.AreaTitle       = "Recently Changed Associates";
                model.AreaMessage     =
                    "The associates in the grid below have had roles assigned to them by the Resource One Security Manager rule engine due to changes in job, department or location.";
                break;

            default:
                RedirectToAction("Index");
                break;
            }

            model.SidebarMenu = BuildSidebarMenu("Associates", model.CurrentMenuItem);

            return(View(model));
        }
        public void AssociateCollection_can_construct_ctor0()
        {
            // AAA - Arrange, Act, Assert
            // Arrange
            var sut = new AssociateCollection();

            // Act

            // Assert
            Assert.That(sut, Is.Not.Null);
            Assert.That(sut.Count, Is.EqualTo(0));
        }
        public void AssociateCollection_can_construct_ctor3()
        {
            // AAA - Arrange, Act, Assert
            // Arrange
            var list = new List <Associate>()
            {
                new Associate(() => new Role(),
                              () => new RolePickList(() => new RoleCollection(),
                                                     () => new Role()),
                              () => new Skill(),
                              () => new SkillPickList(() => new SkillCollection(),
                                                      () => new Skill())
                              )
                {
                    AssociateID = 101, Name = "Aaron Schatzer", Tenure = 10, CurrentRoleID = 100
                },
                new Associate(() => new Role(),
                              () => new RolePickList(() => new RoleCollection(),
                                                     () => new Role()),
                              () => new Skill(),
                              () => new SkillPickList(() => new SkillCollection(),
                                                      () => new Skill())
                              )
                {
                    AssociateID = 102, Name = "Alan Moses", Tenure = 3, CurrentRoleID = 100
                },
                new Associate(() => new Role(),
                              () => new RolePickList(() => new RoleCollection(),
                                                     () => new Role()),
                              () => new Skill(),
                              () => new SkillPickList(() => new SkillCollection(),
                                                      () => new Skill())
                              )
                {
                    AssociateID = 103, Name = "Alexander Chow", Tenure = -1, CurrentRoleID = 100
                }
            };

            // Act
            var sut = new AssociateCollection(list);

            // Assert
            Assert.Multiple(() =>
            {
                Assert.That(sut, Is.Not.Null);
                Assert.That(sut.Count, Is.EqualTo(3));
            });
        }
Пример #5
0
        public ActionResult Index()
        {
            var pageSize = CookieValueAsInt(CookieNames.GridPageSize, Constants.DefaultPageSize);

            var model = new AssociateCollection
            {
                PageTitle    = "Associates",
                DataAction   = "EmployeeListSearch",
                ReviewAction = "Details",
                AreaTitle    = "Associates",
                AreaMessage  = "The grid below contains all associates that have been imported.",
                IsAdmin      = IsAdmin,
                IsReview     = false,
                ReviewMode   = ReviewModes.None,
                PagingModel  = new PagingModel(0, pageSize, 0),
                GridCaption  = "All Associataes",
                SidebarMenu  = BuildSidebarMenu("Associates", "Associates")
            };

            return(View(model));
        }
Пример #6
0
        public HttpResponseMessage GetServiceTechnician(int serv_prov_id_params, String username_ad, String password_ad)
        {
            Authentication_class var_auth   = new Authentication_class();
            AuthenticationHeader authHeader = var_auth.getAuthHeader(username_ad, password_ad);

            AsmRepository.SetServiceLocationUrl(var_auth.var_service_location_url);

            var custservice = AsmRepository.AllServices.GetCustomersService(authHeader);

            AssociateCollection aa = custservice.GetAssociates(serv_prov_id_params, 0);


            if (aa != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, aa));
            }
            else
            {
                var       message = string.Format("error");
                HttpError err     = new HttpError(message);
                return(Request.CreateResponse(HttpStatusCode.OK, message));
            }
        }