public void AddMonthlyPackageMethod_DuplicateInput_ThrowsException() { var sut = new Gym(); var monthlyPackage1 = new MonthlyPackage {Id = 1535235}; sut.AddMonthlyPackage(monthlyPackage1); sut.AddMonthlyPackage(monthlyPackage1); }
private void RejectDuplicateMonthlyPackage(MonthlyPackage monthlyPackage) { if (_monthlyPackages.Contains(monthlyPackage)) { throw new ArgumentException("You cannot add a duplicate MonthlyPackage."); } }
public void BillForMonthlyChargeMethod_CustomerIsFromOntario_ThrowsException() { var monthlyPackage = new MonthlyPackage { Id = 1235, Name = "Top Fit", Price = 9.20M }; var address = new Address("1234 Happy St", "Toronto", "Ontario"); var sut = new Customer { Id = 91352, MonthlyPackage = monthlyPackage, Address = address }; sut.BillForMonthlyCharge(DateTime.Today); }
public void MonthlyPackageProperty_Set_PackageEqualsCustomerMonthlyPackage() { var monthlyPackage = new MonthlyPackage { Id = 91351 }; var sut = new Customer {MonthlyPackage = monthlyPackage}; Assert.AreEqual(monthlyPackage, sut.MonthlyPackage); }
public void BillForMonthlyChargeMethod_CustomerPackageInput_GeneratesBatchWithTransaction() { const decimal price = 12.20M; var monthlyPackage = new MonthlyPackage { Id = 1235, Name = "Top Fit", Price = price }; var sut = new Customer { Id = 91352, MonthlyPackage = monthlyPackage }; var batch = sut.BillForMonthlyCharge(DateTime.Today); Assert.IsTrue(batch.TransactionsContainsChargeOf(price)); }
public void PackageNameAndPriceProperties_Getters_WrapMonthlyPackageProperties() { var monthlyPackage = new MonthlyPackage { Id = 91351, Name = "Top Fit", Price = 35.00M }; var sut = new Customer {MonthlyPackage = monthlyPackage}; Assert.AreEqual(sut.PackageName, monthlyPackage.Name); Assert.AreEqual(sut.PackagePrice, monthlyPackage.Price); }
public void AddMonthlyPackage(MonthlyPackage monthlyPackage) { RejectDuplicateMonthlyPackage(monthlyPackage); _monthlyPackages.Add(monthlyPackage); }
private void RejectDuplicateMonthlyPackage(MonthlyPackage monthlyPackage) { if(_monthlyPackages.Contains(monthlyPackage)) throw new ArgumentException("You cannot add a duplicate MonthlyPackage."); }
public void Constructor_NoInputParams_IsInstanceOfEntityBase() { var sut = new MonthlyPackage(); Assert.IsInstanceOfType(typeof(EntityBase), sut); }
public void BillForMonthlyChargeMethod_CustomerPackagePriceLessThanTenDollars_ThrowsException() { var monthlyPackage = new MonthlyPackage { Id = 1235, Name = "Top Fit", Price = 9.20M }; var sut = new Customer { Id = 91352, MonthlyPackage = monthlyPackage }; sut.BillForMonthlyCharge(DateTime.Today); }