示例#1
0
            private void SetupForClearTests(out ITestProperty prop0, out ITestProperty prop1) {
                ITestObject obj = NewTestObject<Object1>();
                prop0 = obj.GetPropertyByName("Prop0");
                prop1 = obj.GetPropertyByName("Prop1");

                prop0.AssertIsEmpty();
                prop1.AssertIsEmpty();

                prop1.SetValue("Foo");
                prop1.AssertValueIsEqual("Foo");
                prop0.AssertIsEmpty();
            }
示例#2
0
        public virtual void ChangePolymorphicPropertyOnPersistentObject(string customerType, string supplierType)
        {
            var    payment2  = FindById <PolymorphicPayment>(3);
            var    customer1 = FindById <CustomerAsPayee>(1);
            string cusId     = customer1.GetPropertyByName("Id").Title;

            ITestProperty payeeProp     = payment2.GetPropertyByName("Payee");
            ITestProperty payeeLinkProp = payment2.GetPropertyByName("Payee Link").AssertIsUnmodifiable();

            payeeProp.SetObject(customer1);

            ITestObject   payeeLink      = payeeLinkProp.AssertIsNotEmpty().ContentAsObject;
            ITestProperty associatedType = payeeLink.GetPropertyByName("Associated Role Object Type").AssertIsUnmodifiable();

            associatedType.AssertValueIsEqual(customerType);
            ITestProperty associatedId = payeeLink.GetPropertyByName("Associated Role Object Id").AssertIsUnmodifiable();

            associatedId.AssertValueIsEqual(cusId);

            ITestObject sup1  = GetTestService("Supplier As Payees").GetAction("New Instance").InvokeReturnObject().Save();
            string      supId = sup1.GetPropertyByName("Id").Title;

            payeeProp.SetObject(sup1);
            associatedType.AssertValueIsEqual(supplierType);
            associatedId.AssertValueIsEqual(supId);

            payeeProp.ClearObject();
            payeeLinkProp.AssertIsEmpty();
            payeeProp.AssertIsEmpty();
        }
 public void ClearAssociatedObject()
 {
     payee1.SetObject(customer1);
     payee1.ClearObject();
     key1.AssertIsEmpty();
 }
示例#4
0
 private static void CheckForClearTests(ITestProperty prop0, ITestProperty prop1) {
     prop1.AssertIsEmpty();
     prop0.AssertValueIsEqual("Prop1 has been cleared");
 }