コード例 #1
0
        public void ShouldHaveCorrectCardNumber()
        {
            const string cardNumber = "379354508162306";

            var creditCardNumber = CreditCardNumber.For(cardNumber);

            creditCardNumber.Number.ShouldBe(cardNumber);
        }
コード例 #2
0
        public void ImplicitConversionToStringResultsInCorrectString()
        {
            const string cardNumber = "379354508162306";

            var creditCardNumber = CreditCardNumber.For(cardNumber);

            string result = creditCardNumber;

            result.ShouldBe(cardNumber);
        }
コード例 #3
0
        public void ToStringReturnsCorrectFormat()
        {
            const string cardNumber = "379354508162306";

            var creditCardNumber = CreditCardNumber.For(cardNumber);

            var result = creditCardNumber.ToString();

            result.ShouldBe(cardNumber);
        }