public void CollectsParameterValueAtSpecifiedIndex() { var action = new CollectAction(1); action.Invoke(new Invocation(receiver, methodInfo, new object[] {123, "hello"})); Assert.AreEqual("hello", action.Parameter); }
public void CollectsParameterValueAtSpecifiedIndex() { CollectAction action = new CollectAction(1); ((IAction)action).Invoke(new Invocation(receiver, methodInfo, new object[] { 123, "hello" })); Assert.AreEqual("hello", action.Parameter); }
public void ReturnsParameterValueFromMostRecentOfMultipleCalls() { var action = new CollectAction(1); action.Invoke(new Invocation(receiver, methodInfo, new object[] {123, "hello"})); action.Invoke(new Invocation(receiver, methodInfo, new object[] {456, "goodbye"})); Assert.AreEqual("goodbye", action.Parameter); }
public void ReturnsParameterValueFromMostRecentOfMultipleCalls() { CollectAction action = new CollectAction(1); ((IAction)action).Invoke(new Invocation(receiver, methodInfo, new object[] { 123, "hello" })); ((IAction)action).Invoke(new Invocation(receiver, methodInfo, new object[] { 456, "goodbye" })); Assert.AreEqual("goodbye", action.Parameter); }
// Use this for initialization void Start() { //获取路径配置表 GetPathConfig(); state = MoveState.Stay; playerPoints.Nowpoint = startpoint; //获取价格文本,确定和取消按钮 priceText = priceBoard.Find("price/pricetext").GetComponent <Text>(); btn_priceOK = priceBoard.Find("ok").GetComponent <RectTransform>(); btn_priceCancle = priceBoard.Find("cancle").GetComponent <RectTransform>(); btn_okMask = priceBoard.Find("okMask").GetComponent <RectTransform>(); //获取采集文本和采集按钮 MineText = mineActionBoard.Find("Text").GetComponent <Text>(); btn_mine = mineActionBoard.Find("mine").GetComponent <RectTransform>(); btn_mineMask = mineActionBoard.Find("mineMask").GetComponent <RectTransform>(); //获取回家文版 homeText = homeBoard.Find("Text").GetComponent <Text>(); //读取角色配置表 charaModle = GameObject.Find("/CollectionTools/CharacterModle").GetComponent <CharacterModle>(); //获取地图的ui _mapUI = GameObject.Find("/CollectionTools/Colection").GetComponent <MapUI>(); //读取采集控制脚本 collectAction = GameObject.Find("/CollectionTools/Colection").GetComponent <CollectAction>(); //获取事件控制器 eventmanager = transform.Find("/ToolsKit/EventManager").GetComponent <ChatEventManager>(); questManager = transform.Find("/ToolsKit/QuestManager").GetComponent <QuestManager>(); InstPlayer(playerPoints.Nowpoint); AddPathPointListener(); eventmanager.PreCheckEventList(1); questManager.PreCheckQuest(1); questManager.IsArriveWaitingCheckPoint(1); }
public void HasAReadableDescription() { IAction action = new CollectAction(37); AssertDescription.IsEqual(action, "collect argument at index 37"); }
/// <summary> /// Calls the specified <paramref name="collectDelegate"/> with the value that is set to the property. /// Can only be used as action of an expectation on a property setter. /// </summary> /// <typeparam name="TValue">The type of the value.</typeparam> /// <param name="collectDelegate">The collect delegate.</param> /// <returns>Action that collects a property value.</returns> public static IAction PropertyValue <TValue>(CollectAction <TValue> .Collect collectDelegate) { return(new CollectAction <TValue>(0, collectDelegate)); }
/// <summary> /// Calls the specified <paramref name="collectDelegate"/> with the method argument at index <paramref name="argumentIndex"/>. /// Can only be used as action of an expectation on a method call. /// </summary> /// <typeparam name="TArgument">The type of the argument.</typeparam> /// <param name="argumentIndex">Index of the argument.</param> /// <param name="collectDelegate">The collect delegate.</param> /// <returns>Action that collects a method argument.</returns> public static IAction MethodArgument <TArgument>(int argumentIndex, CollectAction <TArgument> .Collect collectDelegate) { return(new CollectAction <TArgument>(argumentIndex, collectDelegate)); }
public async Task Collect (string sessionId, int origin) { await Clients.Caller.SendAsync( "LogMessage", $"Received Request - Collect ({sessionId} - {origin})" ); UserModel user = await userManager.GetUserAsync( Context.GetHttpContext().User ); CollectAction action = await gameActionService.CollectAction( sessionId, user.UserId, origin ); await DoAction( action ); }