public async Task <ActionResult <BabySitter> > PostBabySitter(BabySitter babySitter) { _context.BabySitters.Add(babySitter); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBabySitter", new { id = babySitter.Id }, babySitter)); }
public async Task <IActionResult> PutBabySitter([FromRoute] int id, [FromBody] BabySitter babySitter) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != babySitter.Id) { return(BadRequest()); } _context.Entry(babySitter).State = EntityState.Modified; try { _repo.Update(babySitter); var save = await _repo.SaveAsync(babySitter); } catch (DbUpdateConcurrencyException) { if (!BabySitterExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void BabySitterWhenCalledReturnsValidTimeInto24HoursFomrat() { BabySitter babySitter = new BabySitter(18, 26, 21); Assert.AreEqual(18, babySitter.GetStartTime()); Assert.AreEqual(26, babySitter.GetEndTime()); Assert.AreEqual(21, babySitter.GetBedTime()); }
public async Task <IActionResult> PostBabySitter([FromBody] BabySitter babySitter) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _repo.Add(babySitter); var save = await _repo.SaveAsync(babySitter); return(CreatedAtAction("GetBabySitters", new { id = babySitter.Id }, babySitter)); }
public void SetUp() { _clockInTime = "5PM"; _clockOutTime = "6PM"; _babySitter = new BabySitter(); _familyChoiceA = new FamilyA(); _familyChoiceB = new FamilyB(); _familyChoiceC = new FamilyC(); }
public async Task <IActionResult> PutBabySitter(int id, BabySitter babySitter) { if (id != babySitter.Id) { _context.BabySitters.Add(babySitter); await _context.SaveChangesAsync(); return(NoContent()); } // _context.Entry(babySitter).State = EntityState.Modified; var _babySitter = await _context.BabySitters.FirstAsync(f => f.Id == babySitter.Id); _babySitter.PaymentType = babySitter.PaymentType; _babySitter.Photo = babySitter.Photo; _babySitter.TheBioInformation = babySitter.TheBioInformation; var user = await _context.Users.FirstAsync(x => x.Id == babySitter.User.Id); if (user != null) { user.Phone = babySitter.User.Phone; user.Email = babySitter.User.Email; user.FirstName = babySitter.User.FirstName; user.LastName = babySitter.User.LastName; } try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BabySitterExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private void SetupItemAPI(AssetBundle expandSharedAssets1) { if (!ItemAPISetup) { try { Tools.Init(); ItemBuilder.Init(); BabyGoodHammer.Init(expandSharedAssets1); CorruptionBomb.Init(expandSharedAssets1); if (ExpandSettings.EnableBloodiedScarfFix) { ExpandRedScarf.Init(expandSharedAssets1); } TableTechAssassin.Init(expandSharedAssets1); CorruptedJunk.Init(expandSharedAssets1); BootlegGuns.Init(expandSharedAssets1); CronenbergBullets.Init(expandSharedAssets1); Mimiclay.Init(expandSharedAssets1); TheLeadKey.Init(expandSharedAssets1); RockSlide.Init(expandSharedAssets1); CustomMasterRounds.Init(expandSharedAssets1); WoodenCrest.Init(expandSharedAssets1); BulletKinGun.Init(); BabySitter.Init(expandSharedAssets1); PowBlock.Init(expandSharedAssets1); CursedBrick.Init(expandSharedAssets1); SonicRing.Init(expandSharedAssets1); SonicBox.Init(expandSharedAssets1); WestBrosRevolverGenerator.Init(); HotShotShotGun.Init(); // Setup Custom Synergies. Do this after all custom items have been Init!; ExpandSynergies.Init(); ItemAPISetup = true; } catch (Exception e2) { Tools.PrintException(e2, "FF0000"); } } }
static void Main(string[] args) { BabySitter obj = new BabySitter(); string response = ""; do { Console.WriteLine("BabySitter Wage Calculator "); Console.WriteLine("Enter your Start time: (ex. 5:00pm)"); string startTime = Console.ReadLine(); Console.WriteLine("Enter the child's bed time: (ex. 8:00pm)"); string bedTime = Console.ReadLine(); Console.WriteLine("Enter your stop time: (ex. 1:00am) "); string endTime = Console.ReadLine(); int value = obj.CalculateNightlyRate(startTime, endTime, bedTime); Console.WriteLine("Your total amount comes to: $" + value); Console.WriteLine("Do You Want to do another calculation?"); Console.WriteLine("Enter Y to continue. Hit any key to exit"); response = Console.ReadLine(); } while (response.ToUpper() == "Y"); }
private void SetupItemAPI() { if (!ItemAPISetup) { try { AssetBundle expandSharedAssets1 = ResourceManager.LoadAssetBundle("ExpandSharedAuto"); Tools.Init(); ItemBuilder.Init(); BabyGoodHammer.Init(expandSharedAssets1); CorruptionBomb.Init(expandSharedAssets1); ExpandRedScarf.Init(expandSharedAssets1); TableTechAssassin.Init(expandSharedAssets1); CorruptedJunk.Init(expandSharedAssets1); BootlegGuns.Init(); CronenbergBullets.Init(expandSharedAssets1); Mimiclay.Init(expandSharedAssets1); TheLeadKey.Init(expandSharedAssets1); // TableTechExpand.Init(); RockSlide.Init(expandSharedAssets1); CustomMasterRounds.Init(expandSharedAssets1); WoodenCrest.Init(expandSharedAssets1); BulletKinGun.Init(); BabySitter.Init(expandSharedAssets1); PowBlock.Init(expandSharedAssets1); // Setup Custom Synergies. Do this after all custom items have been Init!; ExpandSynergies.Init(); expandSharedAssets1 = null; ItemAPISetup = true; } catch (Exception e2) { Tools.PrintException(e2, "FF0000"); } } }
public void BabySitterPaymentCalculatorFromStartTimeToMidNight() { BabySitter babySitter = new BabySitter(17, 24, 21); Assert.AreEqual(72, babySitter.PaymentCalculator()); }
public void BabySitterPaymentCalculatorBetweenMidNightHours() { BabySitter babySitter = new BabySitter(26, 28, 21); Assert.AreEqual(32, babySitter.PaymentCalculator()); }
public void BabySitterPaymentCalculatorFromBedTimeToEnd() { BabySitter babySitter = new BabySitter(21, 28, 21); Assert.AreEqual(88, babySitter.PaymentCalculator()); }
public void Init() { babySitter = new BabySitter(18, 23, 21); }
public void BabySitterPaymentCalculatorFromStartToEnd() { BabySitter babySitter = new BabySitter(17, 28, 21); Assert.AreEqual(136, babySitter.PaymentCalculator()); }
public void InitializeTests() { BabySitterObj = new BabySitter(); }
public void BabySitterPaymentCalculatorFromBedTimeToOverMidNight() { BabySitter babySitter = new BabySitter(17, 26, 21); Assert.AreEqual(104, babySitter.PaymentCalculator()); }
public void BabySitterInvalidStartTimeReturnArgumentOutOfRangeException() { BabySitter babySitter = new BabySitter(6, 23, 21); }
public void BabySitterPaymentCalculatorFromBedTimeToMidNight() { BabySitter babySitter = new BabySitter(21, 24, 21); Assert.AreEqual(24, babySitter.PaymentCalculator()); }
public void BabySitterPaymentCalculatorFromMidNightToEnd() { BabySitter babySitter = new BabySitter(24, 28, 21); Assert.AreEqual(64, babySitter.PaymentCalculator()); }
public void BabySitterPaymentCalculatorFromStartTimeToDefualtBedTime() { BabySitter babySitter = new BabySitter(17, 21, 21); Assert.AreEqual(48, babySitter.PaymentCalculator()); }
public void BabySitterPaymentCalculatorForThreeHoursFromValidStartTime() { BabySitter babySitter = new BabySitter(17, 20, 21); Assert.AreEqual(36, babySitter.PaymentCalculator()); }
public void BabySitterInvalidEndTimeReturnsArgumentOutOfRangeException() { BabySitter babySitter = new BabySitter(18, 8, 21); }