public void SetUp() { _textureDataStore = new DataStore(); _faceParser = new FaceParser(_textureDataStore); _groupParser = new GroupParser(_textureDataStore); _normalParser = new NormalParser(_textureDataStore); _textureParser = new TextureParser(_textureDataStore); _vertexParser = new VertexParser(_textureDataStore); _materialStreamProviderSpy = new MaterialStreamProviderSpy(); _materialStreamProviderSpy.StreamToReturn = CreateMemoryStreamFromString(MaterialLibraryString); _materialLibraryLoader = new MaterialLibraryLoader(_textureDataStore); _materialLibraryLoaderFacade = new MaterialLibraryLoaderFacade(_materialLibraryLoader, _materialStreamProviderSpy); _materialLibraryParser = new MaterialLibraryParser(_materialLibraryLoaderFacade); _useMaterialParser = new UseMaterialParser(_textureDataStore); _loader = new Loader.Loaders.ObjLoader(_textureDataStore, _faceParser, _groupParser, _normalParser, _textureParser, _vertexParser, _materialLibraryParser, _useMaterialParser); }
public void Loads_object_correctly_when_material_is_not_found() { _materialStreamProviderSpy.StreamToReturn = null; var materialLibraryLoaderFacade = new MaterialLibraryLoaderFacade(_materialLibraryLoader, _materialStreamProviderSpy); var materialLibraryParser = new MaterialLibraryParser(materialLibraryLoaderFacade); _loader = new Loader.Loaders.ObjLoader(_textureDataStore, _faceParser, _groupParser, _normalParser, _textureParser, _vertexParser, _lineParser, materialLibraryParser, _useMaterialParser); Load(); _loadResult.Vertices.Should().HaveCount(8); _loadResult.Textures.Should().HaveCount(14); _loadResult.Normals.Should().HaveCount(8); _loadResult.Materials.Should().HaveCount(0); _loadResult.Groups.Should().HaveCount(1); var group = _loadResult.Groups.First(); group.Faces.Should().HaveCount(12); group.Material.Should().BeNull(); }
public void SetUp() { _textureDataStore = new DataStore(); _faceParser = new FaceParser(_textureDataStore); _groupParser = new GroupParser(_textureDataStore); _normalParser = new NormalParser(_textureDataStore); _textureParser = new TextureParser(_textureDataStore); _vertexParser = new VertexParser(_textureDataStore); _materialStreamProviderSpy = new MaterialStreamProviderSpy(); _materialStreamProviderSpy.StreamToReturn = CreateMemoryStreamFromString(MaterialLibraryString); _materialLibraryLoader = new MaterialLibraryLoader(_textureDataStore); _materialLibraryLoaderFacade = new MaterialLibraryLoaderFacade(_materialLibraryLoader, _materialStreamProviderSpy); _materialLibraryParser = new MaterialLibraryParser(_materialLibraryLoaderFacade); _useMaterialParser = new UseMaterialParser(_textureDataStore); _loader = new Loader.Loaders.ObjLoader(_textureDataStore, _faceParser, _groupParser, _normalParser, _textureParser, _vertexParser, _materialLibraryParser, _useMaterialParser); }
public void Loads_object_correctly_when_material_is_not_found() { _materialStreamProviderSpy.StreamToReturn = null; var materialLibraryLoaderFacade = new MaterialLibraryLoaderFacade(_materialLibraryLoader, _materialStreamProviderSpy); var materialLibraryParser = new MaterialLibraryParser(materialLibraryLoaderFacade); _loader = new Loader.Loaders.ObjLoader(_textureDataStore, _faceParser, _groupParser, _normalParser, _textureParser, _vertexParser, materialLibraryParser, _useMaterialParser); Load(); _loadResult.Vertices.Should().HaveCount(8); _loadResult.Textures.Should().HaveCount(14); _loadResult.Normals.Should().HaveCount(8); _loadResult.Materials.Should().HaveCount(0); _loadResult.Groups.Should().HaveCount(1); var group = _loadResult.Groups.First(); group.Faces.Should().HaveCount(12); group.Material.Should().BeNull(); }