public void TestEncodeParseFile() { AVFile file1 = AVFileExtensions.Create("Corgi.png", new Uri("http://corgi.xyz/gogo.png")); IDictionary<string, object> value = ParseEncoderTestClass.Instance.Encode(file1) as IDictionary<string, object>; Assert.AreEqual("File", value["__type"]); Assert.AreEqual("Corgi.png", value["name"]); Assert.AreEqual("http://corgi.xyz/gogo.png", value["url"]); AVFile file2 = new AVFile(null, new MemoryStream(new byte[] { 1, 2, 3, 4 })); Assert.Throws<InvalidOperationException>(() => ParseEncoderTestClass.Instance.Encode(file2)); }