Catel.Test.Data.ModelBaseFacts.TheCancelEditMethod.CancelsChangesCorrectlyForObjectWithCustomType C# (CSharp) Method

CancelsChangesCorrectlyForObjectWithCustomType() private method

private CancelsChangesCorrectlyForObjectWithCustomType ( ) : void
return 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);
            }