public void Validate_ReturnsExpectedResults(
            ValidationResult[] innerResults,
            ModelValidationResult[] expectedResults)
        {
            // Arrange
            var adapter = new ValidatableObjectAdapter();
            var model   = new SampleModel();

            foreach (var result in innerResults)
            {
                model.ValidationResults.Add(result);
            }

            var metadata = _metadataProvider.GetMetadataForProperty(
                typeof(SampleModelContainer),
                nameof(SampleModelContainer.SampleModel));
            var validationContext = new ModelValidationContext(
                new ActionContext(),
                metadata,
                _metadataProvider,
                container: null,
                model: model);

            // Act
            var results = adapter.Validate(validationContext);

            // Assert
            Assert.NotNull(results);
            Assert.Equal(expectedResults, results, ModelValidationResultComparer.Instance);
        }
        public void Validate_PassesExpectedNames(
            ModelMetadata metadata,
            string expectedDisplayName,
            string expectedMemberName)
        {
            // Arrange
            var adapter           = new ValidatableObjectAdapter();
            var model             = new SampleModel();
            var validationContext = new ModelValidationContext(
                new ActionContext(),
                metadata,
                _metadataProvider,
                container: new SampleModelContainer(),
                model: model);

            // Act
            var results = adapter.Validate(validationContext);

            // Assert
            Assert.NotNull(results);
            Assert.Empty(results);

            Assert.Equal(expectedDisplayName, model.DisplayName);
            Assert.Equal(expectedMemberName, model.MemberName);
            Assert.Equal(model, model.ObjectInstance);
        }