public void List_ShouldReturn_CreatedCurrencies() { Currency queriedCurrency1, queriedCurrency2; IEnumerable <Currency> queriedCurrencies; using (var dataLayer = DataLayerHelper.CreateDataLayer()) using (var controller = new CurrenciesController(dataLayer)) { queriedCurrency1 = controller.CreateCurrency(TestDataProvider.CreateNewCurrency()); queriedCurrency2 = controller.CreateCurrency(TestDataProvider.CreateAnotherNewCurrency()); queriedCurrencies = controller.List(); } AssertCurrenciesInList(queriedCurrencies, queriedCurrency1, queriedCurrency2); }
public void Delete_Normally_ShouldWork() { Currency createdCurrency, queriedCurrency; IEnumerable <Currency> listedCurrencies; using (var dataLayer = DataLayerHelper.CreateDataLayer()) using (var controller = new CurrenciesController(dataLayer)) { createdCurrency = controller.CreateCurrency(TestDataProvider.CreateNewCurrency()); queriedCurrency = controller.Get(createdCurrency.Id); controller.Delete(createdCurrency.Id); listedCurrencies = controller.List(); } Assert.AreEqual(createdCurrency.Id, queriedCurrency.Id, "Unexpected ID."); Assert.AreEqual(false, listedCurrencies.Any(), "There should be no partners returned."); }