private static FiscalReceiptTotal ModifyValidTotal(Action <FiscalReceiptTotal> modify)
        {
            var total = FiscalReceiptTestData.ValidTotal();

            modify(total);
            return(total);
        }
        public static IEnumerable <object[]> InvalidCommands()
        {
            yield return(new[] { default(AddFiscalReceiptCommand) });

            foreach (var invalidReceipt in FiscalReceiptTestData.InvalidReceipts())
            {
                yield return(new[] { new AddFiscalReceiptCommand {
                                         Receipt = invalidReceipt
                                     } });
            }
        }
Exemplo n.º 3
0
 public static IEnumerable <object[]> InvalidReceipts()
 {
     return(FiscalReceiptTestData.InvalidReceipts().Select(r => new object[] { r }));
 }
Exemplo n.º 4
0
        public static void Validate_Returns_True_Given_Valid_Receipt()
        {
            var isValid = FiscalReceiptValidator.Validate(FiscalReceiptTestData.ValidReceipt());

            Assert.True(isValid);
        }
 private static AddFiscalReceiptCommand ValidCommand()
 {
     return(new AddFiscalReceiptCommand {
         Receipt = FiscalReceiptTestData.ValidReceipt()
     });
 }
 public static IEnumerable <object[]> InvalidReceiptItems()
 {
     return(FiscalReceiptTestData.InvalidReceiptItems().Select(i => new[] { i }));
 }
 public void Validate_Returns_True_For_Valid_Receipt_Item()
 {
     Assert.True(FiscalReceiptItemValidator.Validate(FiscalReceiptTestData.ValidReceiptItem()));
 }
Exemplo n.º 8
0
 public static IEnumerable <object[]> InvalidDiscountOrMarkups()
 {
     return(FiscalReceiptTestData.InvalidDiscountOrMarkups().Select(m => new[] { m }));
 }
Exemplo n.º 9
0
 public void Validate_Returns_True_For_Valid_Discount_Or_Markup()
 {
     Assert.True(FiscalReceiptDiscountOrMarkupValidator.Validate(FiscalReceiptTestData.ValidDiscountOrMarkup()));
 }
 public static IEnumerable <object[]> InvalidTotals()
 {
     return(FiscalReceiptTestData.InvalidTotals().Select(t => new[] { t }));
 }
 public void Validate_Returns_True_For_Valid_Total()
 {
     Assert.True(FiscalReceiptTotalValidator.Validate(FiscalReceiptTestData.ValidTotal()));
 }