public void GetById() { try { test = SetupInstance(); Models.Currency c = CurrencyDAL.Instance.GetCurrencyById(test.Id); Assert.AreEqual("s", c.Sign); } finally { CleanupInstance(); } }
public void GetRate() { try { test = SetupInstance(); decimal rate = CurrencyDAL.Instance.GetCurrencyRate(test.Id); Assert.AreEqual(123, rate); } finally { CleanupInstance(); } }
public void Update() { try { test = SetupInstance(); test.IsoName = "updatedTest"; test.IsoNumber = "new number"; test.Abbreveature = "new tst"; test.Sign = "&"; test.Rate = 456; Assert.IsTrue(CurrencyDAL.Instance.UpdateCurrency(test)); test = CurrencyDAL.Instance.GetCurrencyById(test.Id); Assert.AreEqual("updatedTest", test.IsoName); Assert.AreEqual("new number", test.IsoNumber); Assert.AreEqual("new tst", test.Abbreveature); Assert.AreEqual("&", test.Sign); Assert.AreEqual(456, test.Rate); } finally { CleanupInstance(); } }
private static Models.Currency SetupInstance() { Models.Currency result = new Models.Currency() { Id = 1, IsoName = "name", IsoNumber = "num", Abbreveature = "tst", Sign = "s", Rate = 123 }; Assert.IsTrue(CurrencyDAL.Instance.AddCurrency(result)); result.Id = CurrencyDAL.Instance.GetCurrencyIdByName(result.IsoName); Assert.NotNull(result); return result; }
public void Delete() { test = SetupInstance(); Assert.IsTrue(CurrencyDAL.Instance.DeleteCurrency(test)); }