コード例 #1
0
 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);
 }
コード例 #2
0
        public void Constructor_StreetWithNullCityAndProvince_ThrowsException()
        {
            const string street = "1234 Happy St";
            const string city = "";
            const string province = "MB";

            var sut = new Address(street, city, province);
        }
コード例 #3
0
        public void Constructor_StreetNullWithCityAndProvince_ThrowsException()
        {
            const string street = "";
            const string city = "Winnipeg";
            const string province = "MB";

            var sut = new Address(street, city, province);
        }
コード例 #4
0
        public void TwoInstances_SameConstructorInputs_AreEqual()
        {
            const string street = "1234 Happy St";
            const string city = "Winnipeg";
            const string province = "MB";

            var sut1 = new Address(street, city, province);
            var sut2 = new Address(street, city, province);
            Assert.AreEqual(sut1, sut2);
        }
コード例 #5
0
        public void AddressProperty_Set_AddressEqualsCustomerAddress()
        {
            const string street = "1234 Happy St";
            const string city = "Winnipeg";
            const string province = "MB";

            var address = new Address(street, city, province);

            var sut = new Customer {Address = address};

            Assert.AreEqual(address, sut.Address);
        }