Exemplo n.º 1
0
        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]; });
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 private MapDataManager()
 {
     m_mapDataList = new List <MapData>();
     m_indexMap    = new KeyIndexMap <int>();
 }
Exemplo n.º 4
0
 private CustomerDataManager()
 {
     m_customerList = new List <CustomerData>();
     m_indexMap     = new KeyIndexMap <int>();
 }
 private IngredientDataManager()
 {
     m_ingredientList = new List <IngredientData>();
     m_indexMap       = new KeyIndexMap <int>();
 }
Exemplo n.º 6
0
 private CookwareDataManager()
 {
     m_cookwareList = new List <CookwareData>();
     m_indexMap     = new KeyIndexMap <int>();
 }
Exemplo n.º 7
0
 private FoodDataManager()
 {
     m_foodList      = new List <FoodData>();
     m_indexMap      = new KeyIndexMap <int>();
     m_foodPriceDict = new Dictionary <string, int>();
 }