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