public void CreateMembershipOrderShouldSetTheDateCreatedDate()
        {
            var membershipOrderFactory = new MembershipOrderFactory();

            var membershipOrder = membershipOrderFactory.CreateMembershipOrder();

            Assert.That(membershipOrder.DateCreated, Is.GreaterThanOrEqualTo(DateTime.Now));
        }
Exemplo n.º 2
0
        public MembershipOrder GetMembershipOrderForIndexModel(
            IndexModel indexModel,
            IOrderRepository orderRepository)
        {
            var membershipOrderFactory = new MembershipOrderFactory();

            var membershipOrder = membershipOrderFactory.CreateMembershipOrder();

            membershipOrder.FirstName    = indexModel.FirstName;
            membershipOrder.LastName     = indexModel.LastName;
            membershipOrder.EmailAddress = indexModel.EmailAddress;

            if (indexModel.DateOfBirth.HasValue)
            {
                membershipOrder.DateOfBirth = (DateTime)indexModel.DateOfBirth;
            }

            membershipOrder.CreditCardNumber = indexModel.CreditCardNumber;
            membershipOrder.CreditCardType   = CreditCardType.FromCode(indexModel.SelectedCreditCardType);
            membershipOrder.MembershipOffer  =
                orderRepository.GetMembershipOfferById(indexModel.SelectedMembershipOption);

            return(membershipOrder);
        }