public void TestCheckWhenFull() { UnitStorage uStorage = new UnitStorage(10); uStorage.Gather(20); Assert.True(uStorage.checkFull()); }
public void TestCheckWhenNotFull() { UnitStorage uStorage = new UnitStorage(40); uStorage.Gather(20); Assert.False(uStorage.checkFull()); }
public void TestGatherDoNotExceedCapacity() { int expected = 30; UnitStorage uStorage = new UnitStorage(30); uStorage.Gather(40); int actual = uStorage.getStorage(); Assert.AreEqual(expected, actual); }
public void TestGather() { int expected = 30; UnitStorage uStorage = new UnitStorage(expected); uStorage.Gather(50); int actual = uStorage.getStorage(); Assert.AreEqual(expected, actual); }
public void GatherResource(ResourceType resourceType) { unitStorage.SetResourceType(resourceType); unitStorage.Gather(unitGatherAmount); animator.SetBool("working", true); if (unitStorage.checkFull()) { Debug.Log("unit storage is full"); animator.SetBool("working", false); DepositResource(); } }
public void TestCheckWhenResourceTypeChanged() { UnitStorage uStorage = new UnitStorage(40); uStorage.SetResourceType(ResourceType.Wood); uStorage.Gather(20); uStorage.SetResourceType(ResourceType.Metal); int actual = uStorage.getStorage(); Assert.AreEqual(0, actual); }
public void TestDepositStorage() { int expected = 0; UnitStorage uStorage = new UnitStorage(20); uStorage.Gather(20); uStorage.DepositStorage(); int actual = uStorage.getStorage(); Assert.AreEqual(expected, actual); }