public void GivenSlotLengthAs_1_Then_Get_0() { //Given: maxSlotLength as 1 int maxSlotLength = 1; //When: I call MaxSlotIndex object int result = _maxSlotIndex.GetIndex(maxSlotLength); //Then: I get 0 Assert.AreEqual(0, result); }
public string ValidateSlotNumber(int slotIndex) { string message = string.Empty; int maxSlots = _parkingLotRepository.TotalSlotAllocated(); int maxSlotIndex = _maxSlotIndex.GetIndex(maxSlots); if (slotIndex < 0) { message = "Invalid slot number"; } else if (slotIndex > maxSlotIndex) { message = "Invalid slot number. Maximum possible paking is " + maxSlots; } return(message); }