public void StateMachineTest() { IEnumerable <int> expected = Enumerable.Range(0, 3).Push(4).Value2.Pop().Value2; IEnumerable <int> actual = StateQuery.Stack(); EnumerableAssert.AreSequentialEqual(expected, actual); }
protected IReadOnlyDictionary <string, string> Handle(StateQuery command) { if (command.ContainsProperty(MessageProperties.StateName)) { return(_componentState.GetStateValues(command[MessageProperties.StateName])); } return(_componentState.GetStateValues()); }
protected Task <string> HandleState(StateQuery message) { return(Task.FromResult("xxx")); }
protected bool QueryState(StateQuery message) { var pinNumber = AsInt(MessageProperties.PinNumber); return(_driver.GetState(pinNumber)); }
/// <summary> /// Bind the States /// </summary> private void BindStates() { StateService stateService = new StateService(); StateQuery filters = new StateQuery(); // Parameters filters.Append(StateColumn.CountryCode, lstCountries.SelectedItem.Value); // Get States list TList<State> StatesList = stateService.Find(filters.GetParameters()); lstStateOption.DataSource = StatesList; lstStateOption.DataTextField = "Name"; lstStateOption.DataValueField = "Code"; lstStateOption.DataBind(); ListItem li = new ListItem("Apply to ALL States", "0"); lstStateOption.Items.Insert(0, li); }