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." ); }
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." ); }