Beispiel #1
0
        public void ListTestSaveWhileNotBusyNetOnly()
        {
#if SILVERLIGHT
            DataPortal.ProxyTypeName = "Local";
#else
            System.Configuration.ConfigurationManager.AppSettings["CslaAutoCloneOnUpdate"] = "false";
#endif
            UnitTestContext        context = GetContext();
            ItemWithAsynchRuleList items   = ItemWithAsynchRuleList.GetListWithItems();



            items[0].ValidationComplete += (o2, e2) =>
            {
                context.Assert.IsFalse(items.IsBusy);
                context.Assert.IsTrue(items.IsSavable);
                items = items.Save();
                context.Assert.AreEqual("DataPortal_Update", items[0].OperationResult);
                context.Assert.Success();
            };

            items[0].RuleField = "some value";
            context.Assert.IsTrue(items.IsBusy);
            context.Assert.IsFalse(items.IsSavable);

            context.Complete();
        }
Beispiel #2
0
        public void ListTestSaveWhileBusyNetOnly()
        {
#if SILVERLIGHT
            DataPortal.ProxyTypeName = "Local";
#else
            System.Configuration.ConfigurationManager.AppSettings["CslaAutoCloneOnUpdate"] = "false";
#endif
            UnitTestContext        context = GetContext();
            ItemWithAsynchRuleList items   = ItemWithAsynchRuleList.GetListWithItems();

            items[0].RuleField = "some value";
            context.Assert.IsTrue(items.IsBusy);
            context.Assert.IsFalse(items.IsSavable);
            bool gotError = false;
            try
            {
                items.Save();
            }
            catch (InvalidOperationException EX)
            {
                gotError = true;
            }
            context.Assert.IsTrue(gotError);
            context.Assert.Success();

            context.Complete();
        }
Beispiel #3
0
        public void ListTestSaveWhileNotBusyNetOnly()
        {
            IDataPortal <ItemWithAsynchRuleList> dataPortal = _noCloneOnUpdateDIContext.CreateDataPortal <ItemWithAsynchRuleList>();

            TestResults.Reinitialise();

            UnitTestContext        context = GetContext();
            ItemWithAsynchRuleList items   = ItemWithAsynchRuleList.GetListWithItems(dataPortal);



            items[0].ValidationComplete += (o2, e2) =>
            {
                context.Assert.IsFalse(items.IsBusy);
                context.Assert.IsTrue(items.IsSavable);
                items = items.Save();
                context.Assert.AreEqual("DataPortal_Update", items[0].OperationResult);
                context.Assert.Success();
            };

            items[0].RuleField = "some value";
            context.Assert.IsTrue(items.IsBusy);
            context.Assert.IsFalse(items.IsSavable);

            context.Complete();
        }
Beispiel #4
0
        public void ListTestSaveWhileBusyNetOnly()
        {
            IDataPortal <ItemWithAsynchRuleList> dataPortal = _noCloneOnUpdateDIContext.CreateDataPortal <ItemWithAsynchRuleList>();

            TestResults.Reinitialise();

            UnitTestContext        context = GetContext();
            ItemWithAsynchRuleList items   = ItemWithAsynchRuleList.GetListWithItems(dataPortal);

            items[0].RuleField = "some value";
            context.Assert.IsTrue(items.IsBusy);
            context.Assert.IsFalse(items.IsSavable);
            bool gotError = false;

            try
            {
                items.Save();
            }
            catch (InvalidOperationException)
            {
                gotError = true;
            }
            context.Assert.IsTrue(gotError);
            context.Assert.Success();

            context.Complete();
        }
Beispiel #5
0
        public void ListTestSaveWhileNotBusyNoActiveRuleNetOnly()
        {
            System.Configuration.ConfigurationManager.AppSettings["CslaAutoCloneOnUpdate"] = "false";
            UnitTestContext        context = GetContext();
            ItemWithAsynchRuleList items   = ItemWithAsynchRuleList.GetListWithItems();

            items[0].OperationResult = "something";
            context.Assert.IsFalse(items.IsBusy);
            context.Assert.IsTrue(items.IsSavable);
            items = items.Save();
            context.Assert.AreEqual("DataPortal_Update", items[0].OperationResult);
            context.Assert.Success();
            context.Complete();
        }
Beispiel #6
0
        public void ListTestSaveWhileNotBusyNoActiveRuleNetOnly()
        {
            IDataPortal <ItemWithAsynchRuleList> dataPortal = _noCloneOnUpdateDIContext.CreateDataPortal <ItemWithAsynchRuleList>();

            UnitTestContext        context = GetContext();
            ItemWithAsynchRuleList items   = ItemWithAsynchRuleList.GetListWithItems(dataPortal);

            items[0].OperationResult = "something";
            context.Assert.IsFalse(items.IsBusy);
            context.Assert.IsTrue(items.IsSavable);
            items = items.Save();
            context.Assert.AreEqual("DataPortal_Update", items[0].OperationResult);
            context.Assert.Success();
            context.Complete();
        }