public void ThrowIndexOutOfRangeException_WhenTryingToAddSupplementToNullUnit() { var holdingPen = new SubExtendedHoldingPen(); holdingPen.ParseCommand("insert Dog Sharo"); Assert.Throws <IndexOutOfRangeException>(() => holdingPen.ParseCommand("supplement PowerCatalyst")); }
public void ThrowNotImplementedException_WhenTryingToAddInvalidSupplement() { var holdingPen = new SubExtendedHoldingPen(); holdingPen.ParseCommand("insert Dog Sharo"); Assert.Throws <NotImplementedException>(() => holdingPen.ParseCommand("supplement Power Sharo")); }
public void AttackAttackableUnits_WhenProceedCommandIsPassed() { var holdingPen = new SubExtendedHoldingPen(); holdingPen.ParseCommand("insert Dog Sharo"); holdingPen.ParseCommand("insert Tank Panzer"); holdingPen.ParseCommand("proceed"); Assert.AreEqual(1, holdingPen.ContainedUnits.Count); }
public void AddPowerCatalystSupplement_SupplementCommandWordIsCalled() { var holdingPen = new SubExtendedHoldingPen(); holdingPen.ParseCommand("insert Dog Sharo"); holdingPen.ParseCommand("supplement PowerCatalyst Sharo"); var result = holdingPen.ContainedUnits.FirstOrDefault(x => x.Id == "Sharo"); Assert.AreEqual(8, result.Power); }
public void AddWeaponSupplement_SupplementCommandWordIsCalled() { var holdingPen = new SubExtendedHoldingPen(); holdingPen.ParseCommand("insert Dog Sharo"); holdingPen.ParseCommand("supplement Weapon Sharo"); var result = holdingPen.ContainedUnits.FirstOrDefault(x => x.Id == "Sharo"); Assert.AreEqual(2, result.Aggression); }
public void InfestAttackableUnits_WhenProceedCommandIsPassed() { var holdingPen = new SubExtendedHoldingPen(); holdingPen.ParseCommand("insert Parasite Tereza"); holdingPen.ParseCommand("insert Marine Tanya"); holdingPen.ParseCommand("proceed"); var result = holdingPen.ContainedUnits.FirstOrDefault(x => x.Id == "Tanya"); Assert.AreEqual(3, result.Power); }
public void InsertUnit_WhenExecuteInsertUnitCommandIsCalled(string insertCommands) { var holdingPen = new SubExtendedHoldingPen(); var dog = new Dog("Sharo"); holdingPen.ParseCommand(insertCommands); Assert.AreEqual(1, holdingPen.ContainedUnits.Count); }
public void ThrowIndexOutOfRangeException_WhenTryingToInsertObjectWithoutId() { var holdingPen = new SubExtendedHoldingPen(); Assert.Throws <IndexOutOfRangeException>(() => holdingPen.ParseCommand("insert Dog")); }