Exemplo n.º 1
0
        public void DoesNotThrowOnValidCkan()
        {
            // Arrange
            var sut  = new IsCkanModuleValidator();
            var json = (JObject)ValidCkan.DeepClone();

            // Act
            TestDelegate act = () => sut.Validate(new Metadata(json));

            // Assert
            Assert.That(act, Throws.Nothing,
                        "IsCkanModuleValidator should not throw when passed valid metadata."
                        );
        }
Exemplo n.º 2
0
        public void DoesThrowWhenMissingProperty(string propertyName)
        {
            // Arrange
            var sut  = new IsCkanModuleValidator();
            var json = (JObject)ValidCkan.DeepClone();

            json.Remove(propertyName);

            // Act
            TestDelegate act = () => sut.Validate(new Metadata(json));

            // Assert
            Assert.That(act, Throws.Exception,
                        string.Format("IsCkanModuleValidator should throw when {0} is missing.", propertyName)
                        );
        }