public void TestKeys() { var map = new KeyIndexMap(Keys); Assert.AreEqual(Utf8Keys[0], map[0]); Assert.AreEqual(Utf8Keys[1], map[1]); Assert.AreEqual(Utf8Keys[2], map[2]); Assert.Throws <System.IndexOutOfRangeException>(() => { var key = map[-1]; }); Assert.Throws <System.IndexOutOfRangeException>(() => { var key = map[3]; }); }
public void TestIndices() { var map = new KeyIndexMap(Keys); int index; Assert.IsTrue(map.TryGetIndex(Utf8Keys[0], out index)); Assert.AreEqual(0, index); Assert.IsTrue(map.TryGetIndex(Utf8Keys[2], out index)); Assert.AreEqual(2, index); Assert.IsFalse(map.TryGetIndex(Utf8Keys[3], out index)); }
private MapDataManager() { m_mapDataList = new List <MapData>(); m_indexMap = new KeyIndexMap <int>(); }
private CustomerDataManager() { m_customerList = new List <CustomerData>(); m_indexMap = new KeyIndexMap <int>(); }
private IngredientDataManager() { m_ingredientList = new List <IngredientData>(); m_indexMap = new KeyIndexMap <int>(); }
private CookwareDataManager() { m_cookwareList = new List <CookwareData>(); m_indexMap = new KeyIndexMap <int>(); }
private FoodDataManager() { m_foodList = new List <FoodData>(); m_indexMap = new KeyIndexMap <int>(); m_foodPriceDict = new Dictionary <string, int>(); }