public void DoWithNotEmpty()
		{
			var source = new Dictionary<int, string> { { 1, "a" }, { 2, "b" }, { 3, "c" } };
			var result = new List<string>();

			source.Do((k, v) => result.Add(k.ToString() + "-" + v));

			Assert.AreEqual(source.Count, result.Count);
			Assert.AreEqual("1-" + source[1], result[0]);
			Assert.AreEqual("2-" + source[2], result[1]);
			Assert.AreEqual("3-" + source[3], result[2]);
		}
Example #2
0
        private void Initialize()
        {
            if (_initialized) return;

            _stateChangeStrings = GetStateChangeStrings();
            _actionMap = GetActionMap();
            _characterMap = GetCharacterMap();
            _defaultStateChangeType = GetDefaultStateChange();

            _sequencedDictionary = new SequencedDictionary<char, CharacterType>();
            _characterMap.Do(pair => pair.Value.GetStrings().Do(s => _sequencedDictionary.Add(s, pair.Key)));

            _initialized = true;
        }