public async Task TestLoadJsonUrl() { LottieResult <LottieComposition> result = await LottieCompositionFactory.FromUrlAsync(CanvasDevice.GetSharedDevice(), "https://www.lottiefiles.com/download/427"); Assert.Null(result.Exception); Assert.NotNull(result.Value); }
public void TestNonJsonAssetFile() { LottieResult <LottieComposition> result = LottieCompositionFactory.FromAssetSync(null, "not_json.txt"); Assert.NotNull(result.Exception); Assert.Null(result.Value); }
public void TestLoadInvalidAssetName() { LottieResult <LottieComposition> result = LottieCompositionFactory.FromAssetSync(null, "square2.json"); Assert.Equal(typeof(FileNotFoundException), result.Exception.GetType()); Assert.Null(result.Value); }
public void TestLoadInvalidJsonString() { LottieResult <LottieComposition> result = LottieCompositionFactory.FromJsonStringSync(_notJson, "not_json"); Assert.NotNull(result.Exception); Assert.Null(result.Value); }
public void TestLoadInvalidJsonReader() { JsonReader reader = new JsonReader(new StringReader(_notJson)); LottieResult <LottieComposition> result = LottieCompositionFactory.FromJsonReaderSync(reader, "json"); Assert.NotNull(result.Exception); Assert.Null(result.Value); }