Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void CanAddCurrency()
- {
- var mock = new Mock<ICurrencyRepository>();
- mock.Setup(c => c.GetCurrencies()).Returns(new List<Currency>
- {
- new Currency {Id = 1, Name="USD", ShortName = "United States Dollar", Symbol = "$"},
- });
- var currency1 = new Currency { Id = 2, Name = "ETH", ShortName = "Ethereum", Symbol = "Ξ" };
- var currency2 = new Currency { Id = 3, Name = "BTC", ShortName = "Bitcoin", Symbol = "฿" };
- mock.Object.RegisterNewCurrency(currency1);
- mock.Object.RegisterNewCurrency(currency2);
- var list = mock.Object.GetCurrencies();
- Assert.AreEqual(list.Count, 3);
- Assert.AreEqual(list[1].Id, currency1.Id);
- Assert.AreEqual(list[2].Id, currency2.Id);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement