forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestBitmapProcessorContext.cs
More file actions
31 lines (27 loc) · 981 Bytes
/
TestBitmapProcessorContext.cs
File metadata and controls
31 lines (27 loc) · 981 Bytes
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
using System;
using System.IO;
using Microsoft.Xna.Framework.Content.Pipeline;
using MonoGame.Framework.Content;
using MonoGame.Tests.ContentPipeline;
namespace MonoGame.Tools.Tests
{
internal class TestBitmapProcessorContext : ContextScopeFactory.ContextScope
{
public override string IntermediateDirectory { get; }
public override ContentBuildLogger Logger { get; } = new TestContentBuildLogger();
public override ContentIdentity SourceIdentity { get; }
public TestBitmapProcessorContext()
{
var id = Guid.NewGuid().ToString();
SourceIdentity = new ContentIdentity(id);
IntermediateDirectory = Path.Combine("test", id);
Directory.CreateDirectory(IntermediateDirectory);
}
public override void Dispose()
{
base.Dispose();
// clean up directory
Directory.Delete(IntermediateDirectory, recursive: true);
}
}
}