-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathInMemoryRepository.cs
33 lines (28 loc) · 1017 Bytes
/
InMemoryRepository.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*******************************************************************************
*
* Copyright (c) {2003-2019} Murex S.A.S. and its affiliates.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the MIT License
* which accompanies this distribution, and is available at
* https://opensource.org/licenses/MIT
*
*******************************************************************************/
using System.Collections.Generic;
using Application.Purchase;
using Application.Storage;
namespace Application.Tests.Storage
{
public class InMemoryRepository : IRepository
{
private readonly Dictionary<int, Invoice> _invoiceMap;
public InMemoryRepository()
{
_invoiceMap = new Dictionary<int, Invoice>();
}
public void AddInvoice(Invoice invoice)
{
_invoiceMap.Add(invoice.Id, invoice);
}
public Dictionary<int, Invoice> GetInvoiceMap() => _invoiceMap;
}
}