예제 #1
0
파일: CrudTests.cs 프로젝트: ngs-doo/revenj
 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();
 }
예제 #2
0
파일: CrudTests.cs 프로젝트: zhxjdwh/revenj
        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();
        }
예제 #3
0
        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();
        }
예제 #4
0
        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();
        }