2020-07-31 17:14:25 +02:00
|
|
|
using System.Collections.Generic;
|
2020-07-31 17:25:56 +02:00
|
|
|
using System.IO;
|
2020-07-31 17:14:25 +02:00
|
|
|
using Microsoft.Xna.Framework.Content;
|
2020-07-31 17:25:56 +02:00
|
|
|
using NUnit.Framework;
|
2020-07-31 17:14:25 +02:00
|
|
|
|
|
|
|
namespace Tests.Stub {
|
|
|
|
public class StubContent : ContentManager {
|
|
|
|
|
|
|
|
private readonly Dictionary<string, object> assets;
|
|
|
|
|
2020-07-31 18:51:09 +02:00
|
|
|
public StubContent(StubGame game, Dictionary<string, object> assets) : base(game.Services) {
|
2020-07-31 17:25:56 +02:00
|
|
|
this.RootDirectory = Path.Combine(TestContext.CurrentContext.TestDirectory, "Content");
|
2020-07-31 17:14:25 +02:00
|
|
|
this.assets = assets;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override T Load<T>(string assetName) {
|
|
|
|
return (T) this.assets[assetName];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|