Пример #1
0
        public void DoesThrowWhenIdentifierMissing()
        {
            // Arrange
            var sut = new NetkanValidator();
            var json = new JObject();
            json["spec_version"] = 1;

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

            // Assert
            Assert.That(act, Throws.Exception,
                "NetkanValidator should throw when identifier is missing."
            );
        }
Пример #2
0
        public void DoesNotThrowWhenIdentifierPresent()
        {
            // Arrange
            var sut = new NetkanValidator();
            var json = new JObject();
            json["spec_version"] = 1;
            json["identifier"] = "AwesomeMod";

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

            // Assert
            Assert.That(act, Throws.Nothing,
                "NetkanValidator should not throw when identifier is present."
            );
        }