Beispiel #1
0
        public void LinkContentTypeValidatorShouldReturnCorrectJson(string message, string id, string id2)
        {
            //Arrange
            var validator = new LinkContentTypeValidator(message, id, id2);
            //Act
            var created = validator.CreateValidator();
            var json    = JsonConvert.SerializeObject(created);

            //Assert
            Assert.Equal($@"{{""linkContentType"":[""{id}"",""{id2}""],""message"":""{message}""}}", json);
        }
        private static bool Equals(LinkContentTypeValidator first, LinkContentTypeValidator second)
        {
            if (AreEmptyOrEqual(first.Message, second.Message) == false)
            {
                return(false);
            }
            if (first.ContentTypeIds.SequenceEqual(second.ContentTypeIds) == false)
            {
                return(false);
            }

            return(true);
        }
Beispiel #3
0
        public void LinkContentTypeValidatorShouldReturnCorrectJsonForContentTypes(string message)
        {
            //Arrange
            var cTypes = new List <ContentType>()
            {
                new ContentType {
                    SystemProperties = new SystemProperties {
                        Id = "557"
                    }
                },
                new ContentType {
                    SystemProperties = new SystemProperties {
                        Id = "379"
                    }
                }
            };
            var validator = new LinkContentTypeValidator(cTypes, message);
            //Act
            var created = validator.CreateValidator();
            var json    = JsonConvert.SerializeObject(created);

            //Assert
            Assert.Equal($@"{{""linkContentType"":[""557"",""379""],""message"":""{message}""}}", json);
        }