public void TearDown()
 {
     _inventory  = null;
     _lookup     = null;
     _scriptable = null;
     _reserve    = null;
 }
Exemple #2
0
        public void SetUp()
        {
            var go = new GameObject(string.Format("TestObject-{0}", DateTime.Now.Millisecond));

            _inventory = go.AddComponent <Inventory>();
            _lookup    = go.AddComponent <MockProductLookup>();

            _lookup.AddProduct(new Product {
                Category = ProductCategory.Raw, ID = ProductId, Name = ProductName
            });

            _scriptable                  = ScriptableObject.CreateInstance <InventoryScriptable>();
            _scriptable.Products         = new List <ProductEntryInfo>();
            _scriptable.Placeables       = new List <string>();
            _scriptable.ProductMaxAmount = MaxAmount;
        }
        public void SetUp()
        {
            var go = new GameObject(string.Format("TestObject-{0}", DateTime.Now.Millisecond));

            _inventory = go.AddComponent <Inventory>();
            _lookup    = go.AddComponent <MockProductLookup>();

            _lookup.AddProduct(new Product {
                Category = ProductCategory.Raw, ID = ProductId, Name = ProductName
            });

            _scriptable                  = ScriptableObject.CreateInstance <InventoryScriptable>();
            _scriptable.Products         = new List <ProductEntryInfo>();
            _scriptable.Placeables       = new List <string>();
            _scriptable.ProductMaxAmount = MaxAmount;
            _inventory.BindToScriptable(_scriptable, _lookup);

            _reserve = new InventoryReserve();
            _reserve.Initialize(_inventory);
            _reserve.AddReservation(ProductId, 0, false, false);
        }