public void JsonFileValidator_Validate_returns_Invalid() { var jfv = new JsonFileValidator(); var bytes = Encoding.UTF8.GetBytes("bad json"); jfv.Validate(bytes, "json").ShouldBe(FileStatusCode.Invalid); }
public void JsonFileValidator_Validate_returns_Valid(int i) { var arrayJson = "[{\"key1\":\"value1\"},{\"key2\":\"value2\"},{\"key3\":\"value3\"},{\"key4\":\"value4\"}]"; var simpleJson = "{\"data\":{\"key1\":\"value1\",\"key2\":\"value2\",\"key3\":\"value3\"}}"; var jsonArr = new[] { arrayJson, simpleJson }; var bytes = Encoding.UTF8.GetBytes(jsonArr[i]); var jfv = new JsonFileValidator(); jfv.Validate(bytes, "json").ShouldBe(FileStatusCode.Valid); }
public void JsonFileValidator_Validate_returns_UnSupported() { var jfv = new JsonFileValidator(); jfv.Validate(null, "fff").ShouldBe(FileStatusCode.Unsupported); }