-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFbxWriterTest.cs
More file actions
38 lines (33 loc) · 1.54 KB
/
FbxWriterTest.cs
File metadata and controls
38 lines (33 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PLATEAU.Geometries;
using PLATEAU.MeshWriter;
using PLATEAU.Test.CityGML;
using PLATEAU.Test.GeometryModel;
namespace PLATEAU.Test.MeshWriter
{
[TestClass]
public class FbxWriterTest
{
[TestMethod]
public void WriteGenerateFbxFile()
{
string testDir = Path.GetFullPath("./testDir");
if(Directory.Exists(testDir)) Directory.Delete(testDir, true);
Directory.CreateDirectory(testDir);
using var model = TestGeometryUtil.ExtractModel();
string gmlPath = TestUtil.GetGmlPath(TestUtil.GmlFileCase.Simple);
string fbxFileName = Path.GetFileNameWithoutExtension(gmlPath) + ".fbx";
string fbxPath = Path.Combine(testDir, fbxFileName);
var option = new FbxWriteOptions(FbxFileFormat.Binary, CoordinateSystem.ENU);
bool isSucceed = FbxWriter.Write(fbxPath, model, option);
Assert.IsTrue(isSucceed);
Assert.IsTrue(File.Exists(fbxPath), "fbxファイルが存在します。");
Assert.IsTrue(new FileInfo(fbxPath).Length > 0, "fbxファイルの中身が1バイト以上存在します。");
string expectedTextureDir =
Path.Combine(testDir, "53392642_bldg_6697_appearance");
Assert.IsTrue(Directory.Exists(expectedTextureDir), "テクスチャフォルダが存在します。");
Directory.Delete(testDir, true);
}
}
}