LoadInvalidTests.cs 678 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using NUnit.Framework;
  5. namespace SharpGLTF.Schema2.LoadAndSave
  6. {
  7. [TestFixture]
  8. [AttachmentPathFormat("*/TestResults/LoadAndSave/?", true)]
  9. [Category("Model Load and Save")]
  10. public class LoadInvalidTests
  11. {
  12. [Test]
  13. public void LoadInvalidJsonModel()
  14. {
  15. var path = ResourceInfo.From("Invalid_Json.gltf").FilePath;
  16. Assert.Throws<Validation.SchemaException>(() => ModelRoot.Load(path));
  17. var validation = ModelRoot.Validate(path);
  18. Assert.That(validation.HasErrors, Is.True);
  19. }
  20. }
  21. }