public void CanCreateAggregateRoot() { var locator = Common.StartClient(); var rnd = new Random(); var root = new Finance.Currency { Code = rnd.Next(100, 999).ToString(), Name = "Euro" }; root.Create(); root.Delete(); }
public void CanInsertAggregateRootData() { var repo = locator.Resolve<IRepository<Finance.Currency>>(); var newVal = new Finance.Currency { Code = "ZZZ", Name = "Kuna" }.Create(); var XXX = new Finance.Currency { Code = "XXX", Name = "USD" }; var USD = repo.Find("USD").Result; var oldUSD = USD.Clone(); var ZZZ = repo.Find("ZZZ").Result; USD.Name = "United States $"; var pair = new KeyValuePair<Finance.Currency, Finance.Currency>(oldUSD, USD); var uri = sProxy.Persist<Finance.Currency>(new[] { XXX }, new[] { pair }, new[] { ZZZ }).Result; Assert.AreEqual("XXX", uri[0]); Finance.Currency.Find("XXX").Delete(); }
public void CanInsertAggregateRootData() { var repo = locator.Resolve <IRepository <Finance.Currency> >(); var newVal = new Finance.Currency { Code = "ZZZ", Name = "Kuna" }.Create(); var XXX = new Finance.Currency { Code = "XXX", Name = "USD" }; var USD = repo.Find("USD").Result; var oldUSD = USD.Clone(); var ZZZ = repo.Find("ZZZ").Result; USD.Name = "United States $"; var pair = new KeyValuePair <Finance.Currency, Finance.Currency>(oldUSD, USD); var uri = sProxy.Persist <Finance.Currency>(new[] { XXX }, new[] { pair }, new[] { ZZZ }).Result; Assert.AreEqual("XXX", uri[0]); Finance.Currency.Find("XXX").Delete(); }