public void Assign_User() { var routes = new RouteCollection(); Console.WriteLine("Assign Other Application User.\n"); MRPEntities db = new MRPEntities(); HttpContext.Current = DataHelper.SetUserAndPermission(); UserController objUserController = new UserController(); objUserController.ControllerContext = new ControllerContext(MockHelpers.FakeUrlHelper.FakeHttpContext(), new RouteData(), objUserController); objUserController.Url = MockHelpers.FakeUrlHelper.UrlHelper(); int PlanId = DataHelper.GetPlanId(); Sessions.User.CID = DataHelper.GetClientId(PlanId); Sessions.PlanId = PlanId; Sessions.User.ID = DataHelper.GetUserId(PlanId); BDSService.BDSServiceClient objBDSServiceClient = new BDSService.BDSServiceClient(); var objUser = objBDSServiceClient.GetTeamMemberDetailsEx(Sessions.User.ID, Sessions.ApplicationId); if (objUser != null) { int userId = objUser.ID; string RoleId = objUser.RoleId.ToString(); var result = objUserController.AssignUser(userId, RoleId) as JsonResult; Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name + "\n The Assert Value result: " + result.Data); Assert.IsNotNull(result.Data); } }
public void Email_Exist_with_Old_EmailId() { var routes = new RouteCollection(); Console.WriteLine("To Check Email Exist or Not with existing emailId.\n"); MRPEntities db = new MRPEntities(); HttpContext.Current = DataHelper.SetUserAndPermission(); UserController objUserController = new UserController(); objUserController.ControllerContext = new ControllerContext(MockHelpers.FakeUrlHelper.FakeHttpContext(), new RouteData(), objUserController); objUserController.Url = MockHelpers.FakeUrlHelper.UrlHelper(); int PlanId = DataHelper.GetPlanId(); Sessions.User.CID = DataHelper.GetClientId(PlanId); Sessions.PlanId = PlanId; Sessions.User.ID = DataHelper.GetUserId(PlanId); BDSService.BDSServiceClient objBDSServiceClient = new BDSService.BDSServiceClient(); var objUser = objBDSServiceClient.GetTeamMemberDetailsEx(Sessions.User.ID, Sessions.ApplicationId); if (objUser != null) { string Email = objUser.Email; var result = objUserController.IsEmailExist(Email) as JsonResult; Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name + "\n The Assert Value result: " + result.Data); Assert.IsNotNull(result.Data); } }