public void CreateWithRegionInfoTest() { var i = new RegionInfo("ee-EE"); o = CurrencyObjectFactory.Create(i); validateResults(i.ISOCurrencySymbol, i.CurrencyEnglishName, i.CurrencySymbol); }
public void CreateTest() { var b = GetRandom.Object <CurrencyDbRecord>(); o = CurrencyObjectFactory.Create(b.ID, b.Name, b.Code, b.ValidFrom, b.ValidTo); validateResults(b.ID, b.Name, b.Code, b.ValidFrom, b.ValidTo); }
public static void Initialize(SentryDbContext c) { c.Database.EnsureCreated(); if (c.Currencies.Any()) { return; } var list = new List <string>(); var regions = SystemRegionInfo.GetRegionsList(); foreach (var r in regions) { if (!SystemRegionInfo.IsCountry(r)) { continue; } if (list.Contains(r.ISOCurrencySymbol)) { continue; } var e = CurrencyObjectFactory.Create(r); c.Currencies.Add(e.DbRecord); list.Add(r.ISOCurrencySymbol); } c.SaveChanges(); }
[HttpPost] // [ValidateAntiForgeryToken] public async Task <IActionResult> Create([Bind(properties)] CurrencyViewModel c) { await validateId(c.IsoCode, ModelState); if (!ModelState.IsValid) { return(View(c)); } var o = CurrencyObjectFactory.Create(c.IsoCode, c.Name, c.Symbol, c.ValidFrom, c.ValidTo); await repository.AddObject(o); return(RedirectToAction("Index")); }
public static void Initialize(ICurrencyObjectsRepository c) { if (c.IsInitialized()) { return; } var regions = SystemRegionInfo.GetRegionsList(); foreach (var r in regions) { if (!SystemRegionInfo.IsCountry(r)) { continue; } var e = CurrencyObjectFactory.Create(r); c.AddObject(e); } }
public void CreateWithNullRegionInfoTest() { o = CurrencyObjectFactory.Create(null); validateResults(); }
public void CreateValidFromGreaterThanValidToTest() { o = CurrencyObjectFactory.Create(id, name, code, validTo, validFrom); validateResults(id, name, code, validFrom, validTo); }
public void CreateWithNameOnlyTest() { o = CurrencyObjectFactory.Create(null, name, null); validateResults(name, name); }
public void CreateWithCodeOnlyTest() { o = CurrencyObjectFactory.Create(null, null, code); validateResults(code, code, code); }
public void CreateWithNullArgumentsTest() { o = CurrencyObjectFactory.Create(null, null, null); validateResults(); }