Exemplo n.º 1
0
 private void GivenCardValidatorServiceAndCardInfo()
 {
     cardValidatorService = new CardValidatorService();
     cardInfo             = new CardInfo {
         Number  = "378282246310005",
         Name    = "John Doe",
         Expires = ExpirationMock.ExpiresNow(),
         CCV     = "001"
     };
 }
Exemplo n.º 2
0
        public static TheoryData <string, DateTime> InvalidCardInfoData()
        {
            TheoryData <string, DateTime> data = new TheoryData <string, DateTime>();
            CardInfo cardInfo = new CardInfo {
                Number  = "378282246310005",
                Name    = "John Doe",
                Expires = ExpirationMock.ExpiresNow(),
                CCV     = "001"
            };

            data.Add("378282246310006", cardInfo.Expires);
            data.Add("", cardInfo.Expires);
            data.Add("37828224631000A", cardInfo.Expires);
            data.Add("37828224631000a", cardInfo.Expires);
            data.Add("37828224631000?", cardInfo.Expires);
            data.Add("378282246310005", cardInfo.Expires.AddMonths(-1));
            data.Add("378282246310005", cardInfo.Expires.AddYears(5).AddMonths(1));

            return(data);
        }
        private void GivenSalesOrderAndCardInfo()
        {
            moqCardValidator = new Mock <ICardValidator>();
            moqMerchantServicesAuthorizer = new Mock <IMerchantServicesAuthorizer>();

            // Look to this class for the mockup of sales orders. We still need the mock objects, which is why the local fields are
            // passed by ref.

            new SalesOrdersMock(ref salesOrders, ref salesOrderItems, ref moqDbContext, ref moqSalesOrdersSet, ref moqSalesOrderItemsSet);

            salesOrderManager = new SalesOrderManager(moqCardValidator.Object, moqMerchantServicesAuthorizer.Object, moqDbContext.Object);
            salesOrder        = salesOrders[0];

            cardInfo = new CardInfo {
                Number  = "378282246310005",
                Name    = "John Doe",
                Expires = ExpirationMock.ExpiresNow(),
                CCV     = "001"
            };
        }