Exemplo n.º 1
0
        public void StringCouponBaseConverter_Convert_Percent()
        {
            var converter = new StringCouponBaseConverter();
            var coupon    = Assert.IsType <PercentOffCoupon>(converter.Convert("% 10"));

            Assert.Equal(10, coupon.percent);
        }
Exemplo n.º 2
0
        public void StringCouponBaseConverter_Convert_BXGY()
        {
            var converter = new StringCouponBaseConverter();
            var coupon    = Assert.IsType <BxGyCoupon>(converter.Convert("BXGY apple 1 1"));

            Assert.Equal("apple", coupon.itemName);
            Assert.Equal(1, coupon.X);
            Assert.Equal(1, coupon.Y);
        }
Exemplo n.º 3
0
        public void StringCouponBaseConverter_Convert_TooMuchEnoughInfo()
        {
            var converter = new StringCouponBaseConverter();

            Assert.Null(converter.Convert("BXGY apple 1 1 1"));
        }
Exemplo n.º 4
0
        public void StringCouponBaseConverter_Convert_NotEnoughInfo()
        {
            var converter = new StringCouponBaseConverter();

            Assert.Null(converter.Convert("BXGY"));
        }
Exemplo n.º 5
0
        public void StringCouponBaseConverter_Convert_EmptyStringIsNull()
        {
            var converter = new StringCouponBaseConverter();

            Assert.Null(converter.Convert(""));
        }