public void SetUp() { userStoreMock = new Mock <IUserStore <ApplicationUser> >(); userManagerMock = new Mock <UserManager <ApplicationUser> >(userStoreMock.Object); authManager = new Mock <IAuthenticationManager>(); signinManager = new SignInOperation(userManagerMock.Object, authManager.Object); }
public void SetUp() { userStoreMock = new Mock <IUserStore <User> >(); userManagerMock = new Mock <UserManager <User> >(userStoreMock.Object); authManager = new Mock <IAuthenticationManager>(); cookieMock = new Mock <CookieAuthenticationOptions>(); underTest = new SignInOperation(userManagerMock.Object, authManager.Object, cookieMock.Object); userManagerMock.Setup(a => a.FindByNameAsync(It.IsAny <string>())).ReturnsAsync(new User { UserName = "******" }); authManager.Setup(a => a.SignIn(new AuthenticationProperties { IsPersistent = true }, It.IsAny <ClaimsIdentity>())); userManagerMock.Setup(a => a.CreateIdentityAsync(new User(), DefaultAuthenticationTypes.ApplicationCookie)).ReturnsAsync(new ClaimsIdentity()); authManager.Setup(a => a.SignOut()); }
public override void OnAwake() { if (!isAwake) { Angle = 0; isStop = true; rotateTime = 2; DayAwardList = new List <GameObject>(); AwardCountList = new List <SignInDataTable>(); siginOperation = new SignInOperation(); AwardImaList = new List <Sprite>(); allitems = new List <WrapItem>(); MessageManager.GetInstance.InsertUIDict(this.GetType(), this); Dictionary <int, object> dict = StaticConfigMessage.Instance.GetMapForType(typeof(SignInDataTable)); AwardPanel = XUIUtils.GetCompmentT <Transform>(transform, "AwardPanel"); //遍历这个字典 foreach (object item in dict.Values) { Item = (SignInDataTable)item; //int id = Item.Id; //给奖励数链表添加元素 AwardCountList.Add(Item); } currentVipAward = XUIUtils.GetCompmentT <Text>(transform, "currentVipAward"); nextVipAward = XUIUtils.GetCompmentT <Text>(transform, "nextVipAward"); //获取提示面板以及奖励文本框 tishiPanel = transform.GetChild(4).gameObject; awardText = tishiPanel.transform.GetChild(0).GetChild(0).GetComponent <Text>(); //获取到奖品预设物 Award = Resources.Load("Prefabs/Sign/Oneday") as GameObject; //获取到奖品图片 AwardIma = Award.transform.GetComponent <Image>(); //获取到奖品数量 AwardCount = Award.transform.GetChild(0).GetComponent <Text>(); //获取遮盖 zhegai = Award.transform.GetChild(1).gameObject; residueTimes = XUIUtils.GetCompmentT <Text>(transform, "residueTimes"); //给奖品图片数组添加元素 int a = Resources.LoadAll <Sprite>("Sprite/SignIma/AwardIma").Length; for (int i = 0; i <= a; i++) { //存进商品图片链表中 AwardImaList.Add(Resources.Load <Sprite>("Sprite/SignIma/AwardIma/" + i)); } //获取到关闭按钮添加点击事件 BackeBtn = XUIUtils.GetCompmentT <Button>(transform, "PanelBg/BackBtn"); XUIUtils.ListenerBtn(BackeBtn, BtnCloseOnClick); //获取到签到按钮添加点击事件 signBtn = XUIUtils.GetCompmentT <Button>(transform, "SignBtn"); XUIUtils.ListenerBtn(signBtn, SignBtnOnclick); //获取到升级VIP按钮添加点击事件 upVipBtn = XUIUtils.GetCompmentT <Button>(transform, "upgradeBtn"); XUIUtils.ListenerBtn(upVipBtn, UPVIPOnClick); //获取到GO按钮添加点击事件 goBtn = XUIUtils.GetCompmentT <Button>(transform, "PanelBg/Gobtn"); goimg = XUIUtils.GetCompmentT <Image>(transform, "PanelBg/goimg"); XUIUtils.ListenerBtn(goBtn, GoOnClick); dialTimes = XUIUtils.GetCompmentT <Text>(transform, "residueTimes"); //给轮盘赋值 arrows = XUIUtils.GetCompmentT <Transform>(transform, "PanelBg/Gobtn"); //获取到天数奖励面板 DayAwardPanel = transform.Find("DayAwardPanel"); //生成预设物方法 Instantiate(); //初始化奖品链表 for (int i = 1; i < 13; i++) { allitems.Add(new WrapItem(i, SignInDialDataTable.get(i).awardId)); } //调用获取VIP信息方法 VIPData(); isAwake = true; } }