Esempio n. 1
0
        public void LoyalCustomerForOrdersG100()
        {
            var customer      = CustomerFactory.CreateCustomerInstance(101);
            var loyalCustomer = Assert.IsType <LoyalCustomer>(customer);

            Assert.Equal(10, loyalCustomer.Discount);
        }
Esempio n. 2
0
        [Fact]//Check the discount for the loyal customer
        public void LoyalCustomerDiscountisTenOrNot()
        {
            var customerFactory  = CustomerFactory.CreateCustomerInstance(102);
            var customerdiscount = Assert.IsType <LoyalCustomer>(customerFactory);

            Assert.Equal(10, customerdiscount.Discount);
        }
        public void LoyalCustomerDiscount_Should_Return_10()
        {
            //Arrange
            var customer = CustomerFactory.CreateCustomerInstance(102);

            //Act
            var loyalCustomer = Assert.IsType <LoyalCustomer>(customer);

            //Assert
            Assert.Equal(10, loyalCustomer.Discount);
        }
        public void CustomerForOrders_Less_Than_100_Create_New_Customer()
        {
            //Arrange


            //Act
            var customer = CustomerFactory.CreateCustomerInstance(99);

            //Assert
            Assert.IsType <IdentifyTypeOfObject>(customer);
        }
        public void CustomerForOrders_Over_100_Create_New_LoyalCustomer()
        {
            //Arrange


            //Act
            var customer = CustomerFactory.CreateCustomerInstance(102);

            //Assert
            Assert.IsType <LoyalCustomer>(customer);
        }
Esempio n. 6
0
        [Fact]//Check the type of instance
        public void LoyalCustomerOrderGreaterThanHundred()
        {
            var customerFactory = CustomerFactory.CreateCustomerInstance(102);

            Assert.IsType(typeof(LoyalCustomer), customerFactory);
        }
Esempio n. 7
0
 public void CustomerReturnTypeCheckWhenOrderCountGreaterThan100()
 {
     Assert.IsType <LoyalCustomer>(CustomerFactory.CreateCustomerInstance(122));//检验对象(object)的类型
     // Assert.IsType(typeof(LoyalCustomer),CustomerFactory.CreateCustomerInstance(102));//这里不建议使用typeof去检查 对象的类型
 }