Catel.Test.Data.ModelBaseFacts.TheCancelEditMethod.CancelsChangesCorrectlyForObjectWithCustomType C# (CSharp) Метод

CancelsChangesCorrectlyForObjectWithCustomType() приватный Метод

private CancelsChangesCorrectlyForObjectWithCustomType ( ) : void
Результат void
            public void CancelsChangesCorrectlyForObjectWithCustomType()
            {
                var obj = new ObjectWithCustomType();
                var objEntryAsIEditableObject = (IEditableObject)obj;

                obj.Gender = Gender.Female;

                objEntryAsIEditableObject.BeginEdit();

                obj.Gender = Gender.Male;

                objEntryAsIEditableObject.CancelEdit();

                Assert.AreEqual(Gender.Female, obj.Gender);
            }