예제 #1
0
        public void InternalHasValidationResult_CustomIdentifier_Successfully(string author)
        {
            // Arrange
            var resource = CreateResource(author);

            SetupRemoteAppDataService(true);

            EntityValidationFacade validationFacade = new EntityValidationFacade(ResourceCrudAction.Create, resource, null, null, _metadata, null);

            // Act
            _validator.HasValidationResult(validationFacade, GetAuthorProperty(resource));

            // Assert
            Assert.Contains(Graph.Metadata.Constants.Resource.Author, validationFacade.RequestResource.Properties);
            Assert.Equal(1, validationFacade.ValidationResults.Count);

            string currentAuthor = validationFacade.RequestResource.Properties.SingleOrDefault(p => p.Key == Graph.Metadata.Constants.Resource.Author).Value[0];

            Assert.Equal(author, currentAuthor);
        }