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); }
public void FromCodeShouldReturnTheTargetValue() { var creditCardType = CreditCardType.FromCode("VISA"); Assert.That(creditCardType, Is.EqualTo(CreditCardType.Visa)); }