public void TestSpendShouldFailWhenNotEnoughResource() { ResourceModule resourceModule = new ResourceModule("Buns", 5f, 5f, _subResourceModuleOwner, _subEventContext); Assert.False(resourceModule.Spend(10f)); }
public void TestSpendShouldSucceedWhenJustEnoughResource() { ResourceModule resourceModule = new ResourceModule("Buns", 5f, 5f, _subResourceModuleOwner, _subEventContext); Assert.True(resourceModule.Spend(5f)); }
public void TestCanSpendFalse() { ResourceModule resourceModule = new ResourceModule("Buns", 100f, 100f, _subResourceModuleOwner, _subEventContext); bool succ = resourceModule.Spend(90f); Assert.True(succ); Assert.False(resourceModule.CanSpend(11f)); Assert.True(resourceModule.CanSpend(10f)); }