Ejemplo n.º 1
0
 public void GetById()
 {
     try
     {
         test = SetupInstance();
         Models.Currency c = CurrencyDAL.Instance.GetCurrencyById(test.Id);
         Assert.AreEqual("s", c.Sign);
     }
     finally
     {
         CleanupInstance();
     }
 }
Ejemplo n.º 2
0
 public void GetRate()
 {
     try
     {
         test = SetupInstance();
         decimal rate = CurrencyDAL.Instance.GetCurrencyRate(test.Id);
         Assert.AreEqual(123, rate);
     }
     finally
     {
         CleanupInstance();
     }
 }
Ejemplo n.º 3
0
 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();
     }
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 public void Delete()
 {
     test = SetupInstance();
     Assert.IsTrue(CurrencyDAL.Instance.DeleteCurrency(test));
 }