public void Revalidate_OtherItemBecomesInvalid_RevalidatesOtherItem() { Results.EnabledValidators = ValidatorTypes.Property; Results.SetupFailing().PropertyValidation .Targeting(ItemABC, x => x.ItemProperty) .On(ItemABC); Results.SetupFailing().CollectionPropertyValidation .Targeting(ItemABC, x => x.ItemProperty) .On(OwnerOfAB, CollectionAValidatorKey); ItemA.Revalidate(x => x.ItemProperty);; Results.VerifySetupValidationResults(); }
public void MultipleItemsAreInvalidInSingleCollection_OneInvalidItemIsRevalidated_RevalidatesInvalidItemsAndAddsErrors() { Results.EnabledValidators = ValidatorTypes.Property; Results.SetupFailing().CollectionPropertyValidation .Targeting(ItemA, x => x.ItemProperty) .On(OwnerOfAB, CollectionAValidatorKey); Results.SetupFailing().CollectionPropertyValidation .Targeting(ItemAB, x => x.ItemProperty) .On(OwnerOfAB, CollectionAValidatorKey); ItemA.Revalidate(x => x.ItemProperty);; Results.VerifySetupValidationResults(); }
public void Revalidate_OtherItemWasPreviouslyInvalid_ValidatesUnvalidatedCollectionsOfOtherItem() { Results.EnabledValidators = ValidatorTypes.Property; Results.SetFailed("Previous error").CollectionPropertyValidation .Targeting(ItemABC, x => x.ItemProperty) .On(OwnerOfAB, CollectionAValidatorKey); ItemA.Revalidate(x => x.ItemProperty); ExpectItemPropertyValidationOf(ItemA); ExpectCollectionPropertyValidationOf(OwnerOfAB.CollectionA); ExpectItemPropertyValidationOf(ItemABC); ExpectCollectionPropertyValidationOf(OwnerOfAB.CollectionB); ExpectCollectionPropertyValidationOf(OwnerOfC.CollectionC); Results.VerifyInvocationSequence(); }
public void Revalidate_OtherItemBecomesInvalid_ValidatesUnvalidatedOwnerCollectionsOfOtherItems() { Results.EnabledValidators = ValidatorTypes.Property; Results.SetupFailing().CollectionPropertyValidation .Targeting(ItemABC, x => x.ItemProperty) .On(OwnerOfAB, CollectionAValidatorKey); ItemA.Revalidate(x => x.ItemProperty);; ExpectItemPropertyValidationOf(ItemA); ExpectCollectionPropertyValidationOf(OwnerOfAB.CollectionA); ExpectItemPropertyValidationOf(ItemABC); ExpectCollectionPropertyValidationOf(OwnerOfAB.CollectionB); ExpectCollectionPropertyValidationOf(OwnerOfC.CollectionC); Results.VerifyInvocationSequence(); }
public void MultipleItemsAreInvalidInSingleCollection_OneInvalidItemIsRevalidated_ValidatesOwnerCollectionsAndRevalidatesInvalidItems() { Results.EnabledValidators = ValidatorTypes.Property; Results.SetupFailing().CollectionPropertyValidation .Targeting(ItemA, x => x.ItemProperty) .On(OwnerOfAB, CollectionAValidatorKey); Results.SetupFailing().CollectionPropertyValidation .Targeting(ItemAB, x => x.ItemProperty) .On(OwnerOfAB, CollectionAValidatorKey); ItemA.Revalidate(x => x.ItemProperty);; ExpectItemPropertyValidationOf(ItemA); ExpectCollectionPropertyValidationOf(OwnerOfAB.CollectionA); ExpectItemPropertyValidationOf(ItemAB); ExpectCollectionPropertyValidationOf(OwnerOfAB.CollectionB); Results.VerifyInvocationSequence(); }