Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit 416e8a2

Browse files
committed
Merge pull request #165 from philals/master
Adds Get Value to creditNote that as missed. This caused CoreTests to…
2 parents cb85b16 + c9499e9 commit 416e8a2

File tree

1 file changed

+4
-4
lines changed
  • CoreTests/Integration/Allocations

1 file changed

+4
-4
lines changed

CoreTests/Integration/Allocations/Add.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void allocation_to_invoice()
1515
{
1616
var creditNote = new CreditNotes.CreditNotesTest().Given_an_authorised_creditnote(CreditNoteType.AccountsReceivable);
1717
var invoice = new Create().Given_an_authorised_invoice(InvoiceType.AccountsReceivable);
18-
var expected = Math.Min(creditNote.Total, invoice.Total.GetValueOrDefault());
18+
var expected = Math.Min(creditNote.Total.GetValueOrDefault(), invoice.Total.GetValueOrDefault());
1919

2020
var result = Api.Allocations.Add(new Allocation
2121
{
@@ -34,7 +34,7 @@ public void allocation_to_invoice_minimal()
3434
{
3535
var creditNote = new CreditNotes.CreditNotesTest().Given_an_authorised_creditnote();
3636
var invoice = new Create().Given_an_authorised_invoice();
37-
var expected = Math.Min(creditNote.Total, invoice.Total.GetValueOrDefault());
37+
var expected = Math.Min(creditNote.Total.GetValueOrDefault(), invoice.Total.GetValueOrDefault());
3838

3939
var result = Api.Allocations.Add(new Allocation
4040
{
@@ -54,7 +54,7 @@ public void allocation_on_creditnote()
5454
{
5555
var creditNote = new CreditNotes.CreditNotesTest().Given_an_authorised_creditnote();
5656
var invoice = new Create().Given_an_authorised_invoice();
57-
var expected = Math.Min(creditNote.Total, invoice.Total.GetValueOrDefault());
57+
var expected = Math.Min(creditNote.Total.GetValueOrDefault(), invoice.Total.GetValueOrDefault());
5858

5959
Api.Allocations.Add(new Allocation
6060
{
@@ -114,7 +114,7 @@ public void Credit_notes_show_up_on_invoices()
114114
{
115115
var creditNote = new CreditNotes.CreditNotesTest().Given_an_authorised_creditnote();
116116
var invoice = new Create().Given_an_authorised_invoice();
117-
var amount = Math.Min(creditNote.Total, invoice.Total.GetValueOrDefault());
117+
var amount = Math.Min(creditNote.Total.GetValueOrDefault(), invoice.Total.GetValueOrDefault());
118118

119119
Api.Allocations.Add(new Allocation
120120
{

0 commit comments

Comments
 (0)